Security News
vlt Debuts New JavaScript Package Manager and Serverless Registry at NodeConf EU
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
babel-plugin-redux-saga
Advanced tools
Babel plugin for code instrumenting by extending `redux-saga` code fragments with additional meta-data. Meta-data contains information about code fragment location and other details, that could be consumed by developer tools or libraries. Adding the plugi
Babel plugin for code instrumenting by extending redux-saga
code fragments with additional meta-data. Meta-data contains information about code fragment location and other details, that could be consumed by developer tools or libraries.
Adding the plugin improve logging for errors thrown in your sagas.
Example of setup and demo are available here
Error message without plugin
The above error occurred in task throwAnErrorSaga
created by errorInCallAsyncSaga
created by takeEvery(ACTION_ERROR_IN_CALL_ASYNC, errorInCallAsyncSaga)
created by rootSaga
Error message with the plugin
The above error occurred in task throwAnErrorSaga src/sagas/index.js?16
created by errorInCallAsyncSaga src/sagas/index.js?25
created by takeEvery(ACTION_ERROR_IN_CALL_ASYNC, errorInCallAsyncSaga)
created by rootSaga src/sagas/index.js?78
npm i --save-dev babel-plugin-redux-saga
plugins: [
'babel-plugin-redux-saga'
]
loader: 'babel-loader',
options: {
plugins: [
'babel-plugin-redux-saga'
]
}
All options are optional.
Boolean
false
By default plugin generates relative to the current cwd file paths. But for some reasons absolute path may be required, for such cases configure useAbsolutePath
option. For example, if option is not set:
fileName: "path/to/filename.js"
But if useAbsolutePath
is set to true
,
fileName: "/Users/name/git/project/path/to/filename.js"
Source:
// src/sagas/index.js
function* saga1(){
yield call(foo, 1, 2, 3);
}
function* saga2(){
yield 2;
}
Result:
function* saga1() {
yield Object.defineProperty(call(foo, 1, 2, 3), "@@redux-saga/LOCATION", {
value: {
fileName: "src/sagas/index.js",
lineNumber: 1,
code: "call(foo, 1, 2, 3)"
}
})
}
Object.defineProperty(saga1, "@@redux-saga/LOCATION", {
value: {
fileName: "src/sagas/index.js",
lineNumber: 1
}
})
function* saga2() {
yield 2;
}
Object.defineProperty(saga2, "@@redux-saga/LOCATION", {
value: {
fileName: "src/sagas/index.js",
lineNumber: 5
}
})
Use source maps. It can't be set up in babel
settings.
It also can be set up in your building tools setting. See webpack config for example.
FAQs
Babel plugin for code instrumenting by extending `redux-saga` code fragments with additional meta-data. Meta-data contains information about code fragment location and other details, that could be consumed by developer tools or libraries. Adding the plugi
We found that babel-plugin-redux-saga demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
Security News
Research
The Socket Research Team uncovered a malicious Python package typosquatting the popular 'fabric' SSH library, silently exfiltrating AWS credentials from unsuspecting developers.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.