Skip to content
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 order of init and imports for react onboarding #10020

Merged
merged 4 commits into from
May 27, 2024
Merged

Conversation

lforst
Copy link
Member

@lforst lforst commented May 14, 2024

Copy link

vercel bot commented May 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 27, 2024 9:28am

@lforst lforst requested review from mydea and andreiborza May 14, 2024 13:57
Copy link

codecov bot commented May 14, 2024

Bundle Report

Changes will decrease total bundle size by 12 bytes ⬇️

Bundle name Size Change
sentry-docs-server 7.42MB 3 bytes ⬇️
sentry-docs-edge-server 461.86kB 3 bytes ⬇️
sentry-docs-client 6.18MB 6 bytes ⬇️

Comment on lines 41 to 43
// Make sure Sentry.init() is called before importing any of your other code
import App from "./App";
import { createRoot } from "react-dom/client";
Copy link

@Slessi Slessi May 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't all imports are evalulated first, regardless where they appear in the file? Thought you would need to make a separate file for sentry, and import it first.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends a bit on what the bundlers will do, but I think you are right. Vite seems to hoist the import statements up. I will update. Thanks!

Comment on lines +6 to +11
import {
createRoutesFromChildren,
matchRoutes,
useLocation,
useNavigationType,
} from "react-router-dom";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were missing these

Comment on lines 41 to 43
// Make sure Sentry.init() is called before importing any of your other code
import App from "./App";
import { createRoot } from "react-dom/client";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends a bit on what the bundlers will do, but I think you are right. Vite seems to hoist the import statements up. I will update. Thanks!

Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com>
@lforst lforst merged commit 388b91d into master May 27, 2024
6 checks passed
@lforst lforst deleted the lforst-ract-ordering branch May 27, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants