Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: Add code splitting to reduce bundle size #1285

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

Merged
merged 1 commit into from
May 4, 2022
Merged

feat: Add code splitting to reduce bundle size #1285

merged 1 commit into from
May 4, 2022

Conversation

kylecarbs
Copy link
Member

This splits our pages to use separate JavaScript bundles. It
initially splits the terminal, which reduces our primary
bundle size by ~400KB.

We should do this for all pages, but that can come in a future
change. This leaves the loading page empty for now, which I
think is fine. None of our pages are large enough that the blank
screen temporarily would be concerning.

#761

This splits our pages to use separate JavaScript bundles. It
initially splits the terminal, which reduces our primary
bundle size by ~400KB.

We should do this for all pages, but that can come in a future
change. This leaves the loading page empty for now, which I
think is fine. None of our pages are large enough that the blank
screen temporarily would be concerning.
@kylecarbs kylecarbs self-assigned this May 4, 2022
@kylecarbs kylecarbs requested a review from a team as a code owner May 4, 2022 15:16
@codecov
Copy link

codecov bot commented May 4, 2022

Codecov Report

Merging #1285 (1bc0bd1) into main (4c35b81) will decrease coverage by 0.18%.
The diff coverage is 33.33%.

@@            Coverage Diff             @@
##             main    #1285      +/-   ##
==========================================
- Coverage   66.29%   66.11%   -0.19%     
==========================================
  Files         280      280              
  Lines       18389    18389              
  Branches      216      216              
==========================================
- Hits        12191    12157      -34     
- Misses       4943     4969      +26     
- Partials     1255     1263       +8     
Flag Coverage Δ
unittest-go-macos-latest 53.58% <ø> (-0.11%) ⬇️
unittest-go-postgres- 65.05% <ø> (-0.14%) ⬇️
unittest-go-ubuntu-latest 55.86% <ø> (-0.19%) ⬇️
unittest-go-windows-2022 51.88% <ø> (-0.13%) ⬇️
unittest-js 70.69% <33.33%> (ø)
Impacted Files Coverage Δ
site/src/AppRouter.tsx 0.00% <0.00%> (ø)
site/src/pages/TerminalPage/TerminalPage.tsx 87.50% <100.00%> (ø)
peerbroker/dial.go 77.04% <0.00%> (-6.56%) ⬇️
codersdk/provisionerdaemons.go 61.97% <0.00%> (-5.64%) ⬇️
peer/conn.go 77.88% <0.00%> (-3.69%) ⬇️
peerbroker/listen.go 84.03% <0.00%> (-3.37%) ⬇️
coderd/workspaceagents.go 56.04% <0.00%> (-2.80%) ⬇️
peer/channel.go 84.21% <0.00%> (-2.34%) ⬇️
coderd/provisionerdaemons.go 63.48% <0.00%> (-0.51%) ⬇️
provisioner/echo/serve.go 56.80% <0.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4c35b81...1bc0bd1. Read the comment docs.

Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a comment

Choose a reason for hiding this comment

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

lgtm

@kylecarbs kylecarbs merged commit d7f6321 into main May 4, 2022
@kylecarbs kylecarbs deleted the splitterm branch May 4, 2022 19:24
@misskniss misskniss added this to the V2 Beta milestone May 15, 2022
kylecarbs added a commit that referenced this pull request Jun 10, 2022
This splits our pages to use separate JavaScript bundles. It
initially splits the terminal, which reduces our primary
bundle size by ~400KB.

We should do this for all pages, but that can come in a future
change. This leaves the loading page empty for now, which I
think is fine. None of our pages are large enough that the blank
screen temporarily would be concerning.
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.

3 participants