-
Notifications
You must be signed in to change notification settings - Fork 529
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
Make Plexus output ESM #1219
Make Plexus output ESM #1219
Conversation
Plexus currently outputs a Universal Module Definition, which seems to cause issues during the Vite build as it results in "ambiguous exports". Have Plexus output ESM instead to avoid the issue. Signed-off-by: Máté Szabó <mszabo@fandom.com>
what is the implication of this? My brief read-up indicates that UMD has broader compatibility. What are we losing by switching to ESM? |
output: { | ||
path: layoutDir, | ||
publicPath: '/', | ||
filename: '[name].bundled.js', | ||
library: 'layout.worker.bundled', |
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.
I remember there was some weirdness with this layout.worker - did you try running the deep dependency graphs after this change?
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.
Yeah, I tested rendering a DDG from a proxied-in Jaeger deployment that already had one, and it seems to load and render okay.
Codecov ReportBase: 95.53% // Head: 95.41% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1219 +/- ##
==========================================
- Coverage 95.53% 95.41% -0.12%
==========================================
Files 243 243
Lines 7571 7571
Branches 1898 1898
==========================================
- Hits 7233 7224 -9
- Misses 331 340 +9
Partials 7 7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@yurishkuro As far as I understand, the current build system will just consume this dependency via ESM and bundle/transform it as needed; same for the Vite production build. The main error this should fix is in the Vite dev run, where it seems that the ESM interop code that wraps the output in the UMD case isn't handled well and results in the above error. |
## Which problem is this PR solving? Split from jaegertracing#1212 ## Short description of the changes Plexus currently outputs a Universal Module Definition, which seems to cause issues during the Vite build as it results in "ambiguous exports". Have Plexus output ESM instead to avoid the issue. Signed-off-by: Máté Szabó <mszabo@fandom.com>
Which problem is this PR solving?
Split from #1212
Short description of the changes
Plexus currently outputs a Universal Module Definition, which seems to cause issues during the Vite build as it results in "ambiguous exports". Have Plexus output ESM instead to avoid the issue.