Skip to content

Conversation

@evanpurkhiser
Copy link
Member

@evanpurkhiser evanpurkhiser commented Sep 30, 2021

We don't actually need to wait on initializeMain until after we've completed bootstrapping, which can be done in parallel.

Comment on lines 2 to 78
Copy link
Member

Choose a reason for hiding this comment

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

I think this is slightly harder to read, I would make it a bit more verbose and have some intermediate vars that hold the promises for the import()

  const [bootstrapPromise, initializeMainPromise] = [
    import('app/bootstrap'),
    import('app/bootstrap/initializeMain'),
  ];
  const {bootstrap} = await bootstrapPromise;
  const config = await bootstrap();
  ...

Copy link
Member Author

Choose a reason for hiding this comment

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

good call, I like it

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// We won't need initalizeMain until we've completedd bootstrap. We can start
// We won't need initalizeMain until we've completed bootstrap. We can start

We don't actually need to wait on initializeMain until after we've
completed bootstrapping, which can be done in parallel.
@github-actions
Copy link
Contributor

github-actions bot commented Oct 1, 2021

size-limit report

Path Base Size (493559e) Current Size Change
src/sentry/static/sentry/dist/entrypoints/app.js 52.51 KB 52.66 KB +0.29% 🔺
src/sentry/static/sentry/dist/entrypoints/sentry.css 70.89 KB 70.89 KB 0%

@evanpurkhiser evanpurkhiser merged commit 4b7180b into master Oct 1, 2021
@evanpurkhiser evanpurkhiser deleted the evanpurkhiser/ref-js-improve-app-boot-ordering branch October 1, 2021 02:28
@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants