Skip to content

Commit

Permalink
Fix takeEverys not yielding with babel macro for typed-redux-sagas
Browse files Browse the repository at this point in the history
  • Loading branch information
wbobeirne committed Dec 16, 2021
1 parent bd44386 commit fee58d3
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"antd": "^3.26.12",
"babel-loader": "^8.1.0",
"babel-plugin-import": "^1.13.3",
"babel-plugin-macros": "^3.1.0",
"babel-plugin-module-resolver": "^4.0.0",
"bn.js": "^5.1.3",
"buffer": "^6.0.3",
Expand All @@ -78,7 +79,6 @@
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.2",
"redux-logger": "^3.0.6",
"redux-saga": "^1.1.3",
"semver": "^7.3.2",
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/account/sagas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { takeLatest, select, call, all, put } from 'typed-redux-saga';
import { takeLatest, select, call, all, put } from 'typed-redux-saga/macro';
import BN from 'bn.js';
import { selectNodeLibOrThrow } from 'modules/node/selectors';
import { getNodePubKey } from 'modules/node/sagas';
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/channels/sagas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { takeLatest, select, call, all, put } from 'typed-redux-saga';
import { takeLatest, select, call, all, put } from 'typed-redux-saga/macro';
import { selectNodeLibOrThrow } from 'modules/node/selectors';
import { requirePassword } from 'modules/crypto/sagas';
import { safeGetNodeInfo, safeConnectPeer, sleep } from 'utils/misc';
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/crypto/sagas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { takeLatest, put, select, take, call } from 'typed-redux-saga';
import { takeLatest, put, select, take, call } from 'typed-redux-saga/macro';
import { encryptData, TEST_CIPHER_DATA } from 'utils/crypto';
import { getPasswordCache, setPasswordCache } from 'utils/background';
import { syncTypes } from 'modules/sync';
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/node/sagas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { take, takeLatest, call, put, select, all } from 'typed-redux-saga';
import { take, takeLatest, call, put, select, all } from 'typed-redux-saga/macro';
import * as actions from './actions';
import {
selectNodeLibOrThrow,
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/onchain/sagas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { takeLatest, select, call, put } from 'typed-redux-saga';
import { takeLatest, select, call, put } from 'typed-redux-saga/macro';
import { selectNodeLibOrThrow } from 'modules/node/selectors';
import types from './types';

Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/payment/sagas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { takeEvery, call, select, put } from 'typed-redux-saga';
import { takeEvery, call, select, put } from 'typed-redux-saga/macro';
import {
selectNodeLibOrThrow,
selectNodeInfo,
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/peers/sagas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { takeLatest, select, call, all, put } from 'typed-redux-saga';
import { takeLatest, select, call, all, put } from 'typed-redux-saga/macro';
import { selectNodeLibOrThrow } from 'modules/node/selectors';
import { requirePassword } from 'modules/crypto/sagas';
import { safeGetNodeInfo, safeConnectPeer } from 'utils/misc';
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/rates/sagas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { takeLatest, call, put } from 'typed-redux-saga';
import { takeLatest, call, put } from 'typed-redux-saga/macro';
import { CHAIN_TYPE, Fiat } from 'utils/constants';
import { fetchRates } from './actions';
import { apiFetchRates } from 'lib/cryptocompare';
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/sign/sagas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { takeLatest, select, call, put } from 'typed-redux-saga';
import { takeLatest, select, call, put } from 'typed-redux-saga/macro';
import { SignMessageResponse as WebLNSignMessageResponse } from 'webln';
import { selectNodeLibOrThrow } from 'modules/node/selectors';
import { requirePassword } from 'modules/crypto/sagas';
Expand Down
4 changes: 2 additions & 2 deletions src/app/modules/sync/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
take,
fork,
delay,
} from 'typed-redux-saga';
} from 'typed-redux-saga/macro';
import { browser } from 'webextension-polyfill-ts';
import {
selectSalt,
Expand Down Expand Up @@ -102,7 +102,7 @@ export function* decryptSyncedData(syncConfig: SyncConfig<any>, data: any) {
yield put({ type: types.FINISH_DECRYPT });
}

export default function* cryptoSagas() {
export default function* syncSagas() {
yield takeEvery(types.CLEAR_DATA, clearData);

// First fetch sync'd data and hydrate the store
Expand Down
1 change: 1 addition & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ module.exports = {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react'],
plugins: ['macros'],
overrides: [
{
presets: [
Expand Down
18 changes: 11 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@
"@babel/helper-validator-option" "^7.14.5"
"@babel/plugin-transform-typescript" "^7.16.1"

"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.15.4", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2":
"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2":
version "7.16.5"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.5.tgz#7f3e34bf8bdbbadf03fbb7b1ea0d929569c9487a"
integrity sha512-TXWihFIS3Pyv5hzR7j6ihmeLkZfrXGxAr5UfSl8CHf+6q/wpiYDkUau0czckpYG8QmnCIuPpdLtuA9VmuGGyMA==
Expand Down Expand Up @@ -1878,6 +1878,15 @@ babel-plugin-macros@^2.8.0:
cosmiconfig "^6.0.0"
resolve "^1.12.0"

babel-plugin-macros@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1"
integrity sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==
dependencies:
"@babel/runtime" "^7.12.5"
cosmiconfig "^7.0.0"
resolve "^1.19.0"

babel-plugin-module-resolver@^4.0.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/babel-plugin-module-resolver/-/babel-plugin-module-resolver-4.1.0.tgz#22a4f32f7441727ec1fbf4967b863e1e3e9f33e2"
Expand Down Expand Up @@ -5390,11 +5399,6 @@ rechoir@^0.7.0:
dependencies:
resolve "^1.9.0"

redux-devtools-extension@^2.13.2:
version "2.13.9"
resolved "https://registry.yarnpkg.com/redux-devtools-extension/-/redux-devtools-extension-2.13.9.tgz#6b764e8028b507adcb75a1cae790f71e6be08ae7"
integrity sha512-cNJ8Q/EtjhQaZ71c8I9+BPySIBVEKssbPpskBfsXqb8HJ002A3KRVHfeRzwRo6mGPqsm7XuHTqNSNeS1Khig0A==

redux-logger@^3.0.6:
version "3.0.6"
resolved "https://registry.yarnpkg.com/redux-logger/-/redux-logger-3.0.6.tgz#f7555966f3098f3c88604c449cf0baf5778274bf"
Expand Down Expand Up @@ -5535,7 +5539,7 @@ resolve-pathname@^3.0.0:
resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-3.0.0.tgz#99d02224d3cf263689becbb393bc560313025dcd"
integrity sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==

resolve@^1.12.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.3.2, resolve@^1.9.0:
resolve@^1.12.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.3.2, resolve@^1.9.0:
version "1.20.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==
Expand Down

0 comments on commit fee58d3

Please sign in to comment.