-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: ADR to make redux dependency optional #275
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #275 +/- ##
=======================================
Coverage 80.79% 80.79%
=======================================
Files 38 38
Lines 885 885
Branches 163 163
=======================================
Hits 715 715
Misses 159 159
Partials 11 11 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, looking great! Added a few nits/suggestions for consideration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work? Webpack is doing the transpilation of import statements, and I'm fairly certain it'll explode if the package doesn't exist. This is what the "fallback" option in webpack configs helps with... it lets webpack proceed with a fallback value instead of blowing up. I think.
hmm good point, I was hoping (I have not tried this yet) to use the method described (try..catch basically) in t he npm doc to avoid failures in case of missing import. but if that does not like you said then fallback may be what I have to use. But not sure what we would fallback to, in this case, just a null perhaps? |
also was thinking of dynamic import like this , would this enable us to completely contain this change inside the frontend-platform? see below for an untested idea in OptionalReduxProvider.... I have to leave for the day but interested in exploring both the fallback and dynamic import options The fallback I was not clear if needs to be in consumer webpack or frontend-build webpack files? It would not be ideal if consumers have to edit their webpack files for this?
|
@adamstankiewicz suggested perhaps we can explore not even attempting an import, in the case store is not provided, within the method call instead of at top level thus comletely obviating the need to import react-redux unless store is provided will explore this option too, thanks Adam |
I haven't had a chance to get back to this yet but the next steps it to try the above proposed dynamic import |
Hey @binodpant, What is the current status of this PR, is it ready to review and merge? |
Thanks for the pull request, @binodpant! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. Once you've signed the CLA, please allow 1 business day for it to be processed. After this time, you can re-run the CLA check by adding a comment here that you have signed it. If the problem persists, you can tag the |
Closing this for now as it has been inactive for quite some time. |
@binodpant Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future. |
Description:
An ADR to explore a way to make redux and react-redux optional dependencies for consumers of frontend-platform that don't actually use the 'store' feature of the AppProvider
Merge checklist:
frontend-platform
. This can be done by runningnpm start
and opening http://localhost:8080.module.config.js
file infrontend-build
.fix
,feat
) and is appropriate for your code change. Consider whether your code is a breaking change, and modify your commit accordingly.Post merge: