This repository was archived by the owner on Nov 20, 2023. It is now read-only.
Closed
Conversation
thi plugin now injects additional SENTRY_RELEASES variable into global scope as an object that holds versions for all apps keyed by [project]@[org]
…thub.com/hasanayan/sentry-webpack-plugin into feature/enable-module-federation-support
Contributor
Author
|
@kamilogorek @AbhiPrasad this PR is ready for review now. Is there anything I can do to help you review this? |
Contributor
|
Thanks, I'll try to review it this week |
Contributor
|
Code looks mostly fine, however integration tests are failing right now. (I'll be gone for the next 2 weeks, vacations time) |
Contributor
Author
|
@kamilogorek it's been a while since I looked at the code, can I run these tests locally? Otherwise, could you grant me permission to run the tests whenever I push code to this branch? |
Contributor
|
https://github.com/getsentry/sentry-webpack-plugin/blob/master/.github/workflows/ci.yml These are only test commands run in the CI. |
Contributor
Author
|
@kamilogorek alright, I'll fix the problems in the coming days. Happy vacations. |
Contributor
Author
|
re-created this PR in #307 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR;
the plugin now injects additional SENTRY_RELEASES variable into global scope as an object that holds versions for all apps keyed by [project]@[org]
When ModuleFederationPlugin is used, assuming the project has a single entry in the webpack config, the build outputs a bundle with two separate entrypoints; usually named as 'main' and 'remoteEntry'. Main is used when the app is running in standalone (host) mode and remoteEntry is used when it is consumed as a remote by another app. In our projects we needed to access the version value for all remotes on our host app so that we can create SentryClient per remote with their own respective versions.
With this PR, the code injected by loader is improved to include a second variable
SENTRY_RELEASESin addition toSENTRY_RELEASE. This code goes to main module and is not loaded when the app is running as remote. So I also added the part to tap into compilation and inject the variable in remoteEntry as well.If this is accepted, we can maybe open another PR on @sentry/browser so that the default release is read from SENTRY_RELEASES and retire SENTRY_RELEASE