-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(profiler): scope require to binding import call #13834
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
Closed
Closed
Changes from 12 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
947e70c
ref(profiler): dont store require on globalThis
JonasBa 782fbfc
ref(js): only shim require
JonasBa a92ae7e
ref(cjs) test alternative
JonasBa c175330
ref(profiling) shim import and make createRequire local
JonasBa 7eaa1c3
test: assert require is undefined in e2e
JonasBa caebfe3
remove stray lockfile
JonasBa 8ebb86e
test a different reference
JonasBa 5cef825
lint
JonasBa 57f3848
test without shim
JonasBa 6e5a56e
lets see if this breaks bundlers
JonasBa cee0c6f
format
JonasBa b225765
Merge branch 'develop' into jb/profiling/requrie
JonasBa 2a49051
ref: add issue comment
JonasBa 489af9f
Merge branch 'develop' into jb/profiling/requrie
JonasBa bdfb055
ref: test module require
JonasBa 7580ca0
Revert "ref: test module require"
JonasBa d7d89ae
second take
JonasBa e917565
bad dirname
JonasBa 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
20 changes: 20 additions & 0 deletions
20
dev-packages/e2e-tests/test-applications/node-profiling/index.mjs
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as Sentry from '@sentry/node'; | ||
import { nodeProfilingIntegration } from '@sentry/profiling-node'; | ||
|
||
const wait = ms => new Promise(resolve => setTimeout(resolve, ms)); | ||
|
||
Sentry.init({ | ||
dsn: 'https://[email protected]/6625302', | ||
integrations: [nodeProfilingIntegration()], | ||
tracesSampleRate: 1.0, | ||
profilesSampleRate: 1.0, | ||
}); | ||
|
||
Sentry.startSpan({ name: 'Precompile test' }, async () => { | ||
await wait(500); | ||
}); | ||
|
||
// assert that we dont override require | ||
if (globalThis.require !== undefined) { | ||
throw new Error('globalThis.require should not be defined, check that profiling integration is not defining it'); | ||
} |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.