-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Support code injection in webpack 5 #1563
Conversation
Nice find! Can you point to where this change is documented by Webpack? And I presume with this change we will support independently upgrading the renderer and individual component packages from 4 to 5? |
@@ -1,6 +1,6 @@ | |||
MIT License | |||
|
|||
Copyright (c) 2019 Plotly |
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.
FYI, as I wrote in https://github.com/plotly/dash-core/issues/324
I've seen some major packages like React drop the copyright year - that simplifies managing these and apparently doesn't have a strong downside, so I'd propose we do the same.
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.
Will bump to 2021 for now and until the discussion on this happens
@alexcjohnson I can't find a reference to this in the plugins documentation and the fix is mostly through figuring out what it calls and what the expected behavior seems to be. It seems to boil down to major change in the internal implementation with Their own usage changed accordingly between the versions, moving from arrays of values to string buffers. Yes, the proposed code change should work fine with both Webpack 4 and 5 and allow individual projects to transition to the new version at their own pace. |
OK so if in 4.x the array was eventually evaluated as |
Yes 😁 |
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.
Beautiful 💃
Just one little 🔪 comment
The webpack-dash-dynamic-import plugin was written with Webpack 4.x in mind. With Webpack 5.x the API for plugins changed in a way that makes the existing code injection produce invalid JS bundles. This PR makes the injection work with both 4.x and 5.x.
Related to plotly/dash-table#875
Sanity check against Webpack 4.x project: https://app.circleci.com/pipelines/github/plotly/dash-core-components?branch=sanity-webpack-4and5