-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Fix translation in dev mode #31045
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
Fix translation in dev mode #31045
Conversation
| globals: { | ||
| "react": "react", | ||
| "react-dom": "ReactDom", | ||
| "counterpart": "counterpart", |
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.
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.
To test it, I put counterpart as a dev dependencies of a EW module using this build of shared components. I was able to load the load counterpart in the shared components in the storybook of this module
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.
That isn't what externals/globals does though, that's just node traversing up directories and picking up ../node_modules
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.
So putting into a peer deps is enough?
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.
In the case of where we want to use it both built and bypassing its build system like EW does, I'd imagine both should depend on it for real, then element-web's webpack just ensures there is only one copy of counterpart in its build using a resolve alias
That way all 3 permutations work:
- Install ew deps only
- Install sc deps only
- Install deps in both
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.
Okay, I made EW to resolve counterpart to the one in its node modules.


Regression due to #31034
If shared components dependencies are installed locally, two instance of counterparts are used (one by EW and one by shared components)