GithubHelp home page GithubHelp logo

rekit-plugin-redux-saga's Introduction

rekit-plugin-redux-saga

Use redux-saga for async actions instead of default redux-thunk.

rekit-plugin-redux-saga's People

Contributors

supnate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rekit-plugin-redux-saga's Issues

Memory leak when running Jest tests due to nock not restoring https global

Description
Our CI build was running out of memory and crashing as the number of actions and Jest tests increased. Narrowed the issue down to our Redux action tests, and eventually found out that nock was the culprit. The same issue and the fix are described here: nock/nock#1448

Essentially, on import nock is modifying the global https object to intercept outgoing API calls, and that change needs to be restored with nock.restore(). The call to nock.cleanAll() just clears any mock calls that have been set up.

To Repro
In any project with multiple action tests, run the test suite with memory usage logging turned on like so:
node --expose-gc <your_test_runner.js> --env=jsdom --no-watch --runInBand --logHeapUsage

Expected
Memory usage should be more or less flat, with the heap size rising and falling as GC takes place

Actual
Specific experiences may vary depending on the tests being run, and total memory available, but in our case there is a linear increase in RAM usage growing by roughly 15-30MB per test until the test run completes, or a Node exception is thrown when memory runs out.

Note that this may be an issue that test runners other than Jest can compensate for or handle differently. We have an older Rekit project that was using Mocha, and this issue never came up.

Error when loading plugin

Hey @supnate thanks for all your work with rekit! I installed this plugin using yarn, yarn add rekit-plugin-redux-saga and ran into a couple of errors. After yarn added the package, using the rekit cli command that is on the rekit docs rekit install-plugin rekit-plugin-redux-saga fails due to cmd syntax error. It seems that the proper command is rekit install rekit-plugin-redux-saga, which seemed to work fine. However, when I was using Portal to create a new Feature, I got an error in the UI stating TypeError: cannot read property 'hooks' of null, in a small 'Operation Failed' modal. Additionally, I received this error message and stack trace in the console:

Warning: Failed to load plugin: redux-saga, TypeError: Cannot read property 'app' of undefined.
TypeError: Cannot read property 'app' of undefined
    at module.exports (C:\Users\me\anya\node_modules\rekit-plugin-redux-saga\action.js:16:24)
    at config.accept.forEach (C:\Users\me\anya\node_modules\rekit-core\core\plugin.js:88:71)
    at Array.forEach (native)
    at plugins.map (C:\Users\me\anya\node_modules\rekit-core\core\plugin.js:85:23)
    at Array.map (native)
    at loadPlugins (C:\Users\me\anya\node_modules\rekit-core\core\plugin.js:75:21)
    at getPlugins (C:\Users\me\anya\node_modules\rekit-core\core\plugin.js:15:5)
    at Object.getCommand (C:\Users\me\anya\node_modules\rekit-core\core\plugin.js:119:17)
    at Object.handleCommand (C:\Users\me\anya\node_modules\rekit-core\core\index.js:364:20)
    at execCmd (C:\Users\me\anya\node_modules\rekit-portal\middleware\index.js:63:17)

I'm fairly certain that I've followed the documentation to the letter, though I think the plugin installation could be improved upon a bit. Any idea why I'm receiving this error? Thanks for your help man

Update to newest version

I know you're a busy man and I can see you're all over different stuff but still it would be nice to have an update to the latest saga. I really enjoy rekit and the opinionated approach, it relieves me of busting my head about how to structure things. Thanks for the work so far!

Error after installing plugin

Installning plugin with

rekit install rekit-plugin-redux-saga

then running

rekit add feature user

generate error:

Error: Can't find such file: [PATH TO PROJECT]/src/common/rootSaga.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.