This repository was archived by the owner on Nov 20, 2023. It is now read-only.
-
Couldn't load subscription status.
- Fork 116
add support for multiple apps using module federation #307
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
529cf3e
add support for multiple apps using module federetion
hasanayan 6ff7cef
Update src/index.js
hasanayan 3fb1970
fixed failing integration test
hasanayan 576615f
Update src/sentry.loader.js
hasanayan fddc3de
Update example/test.js
kamilogorek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,15 @@ | ||
| module.exports = function sentryLoader(content, map, meta) { | ||
| const { releasePromise } = this.query; | ||
| const { releasePromise, org, project } = this.query; | ||
| const callback = this.async(); | ||
| releasePromise.then(version => { | ||
| const sentryRelease = `(typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}).SENTRY_RELEASE={id:"${version}"};`; | ||
| let sentryRelease = `const _global = (typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}); _global.SENTRY_RELEASE={id:"${version}"};`; | ||
| if (project) { | ||
| const key = org ? `${project}@${org}` : project; | ||
| sentryRelease += ` | ||
| _global.SENTRY_RELEASES=_global.SENTRY_RELEASES || {}; | ||
| _global.SENTRY_RELEASES["${key}"]={id:"${version}"}; | ||
| `; | ||
| } | ||
| callback(null, sentryRelease, map, meta); | ||
| }); | ||
| }; |
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.
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.
Why remove this
process.exit, and why not add it to the previous check? Should we expect to find all the assignments? If we successfully find one but fail the others, should we exit? If this is the case, should we move theprocess.exit(0)in the last block to run after it?Uh oh!
There was an error while loading. Please reload this page.
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 used to be only one step check of existence on a string. Now the test does 3-step check (for existence of 3 different strings). when any of them fails, we call
process.exit(1). However, callingprocess.exit(0)should be done when only the last check passes successfully because; let's say if we put it on success case of the first case, the test will simply finish without continuing on the next steps.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 moving the last
process.exit(0)out of the block, so that the logic is the same?Instead of:
this instead:
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.
Agree with Iker. Updated the test. Last
process.exit(0)is redundant anyway, as scripts by default exit with0