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

Hack week: add bundle analyzer #27567

Closed
wants to merge 1 commit into from
Closed

Hack week: add bundle analyzer #27567

wants to merge 1 commit into from

Conversation

noelledaley
Copy link
Contributor

@noelledaley noelledaley commented Jun 21, 2024

Description

Installs webpack-bundle-analyzer to analyze the bundle and look for inefficiencies.

Instructions

Pull down this branch and run:

$ yarn && yarn run ember server --environment=production

Then open http://127.0.0.1:8888 to view.

Example:

Screenshot 2024-06-21 at 11 41 34 AM

Using this tool revealed that swagger-ui-dist is taking up a very large portion of one of the main JS chunks. This tells us that the swagger-ui-related code isn't being lazy loaded, which is not ideal since it's a portion of our UI that is sparsely used. Other downsides include:

  • Increased Load Time: our JavaScript bundle will take longer to download and parse, leading to slower initial load times for users
  • Performance Impact: a larger bundle can impact the time it takes for the browser to execute the JavaScript, potentially delaying the time until the page becomes interactive

I looked into trying to dynamically import the swagger-ui related code inside the SwaggerUi component but ran into issues where webpack couldn't properly load the module. It'd be a good thing to explore in the future, though!

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Jun 21, 2024
@noelledaley noelledaley changed the title UI: add bundle analyzer Hack week: add bundle analyzer Jun 21, 2024
Copy link

CI Results:
All Go tests succeeded! ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant