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

improve: speed up addin loading with webpack code splitting #610

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mohit038
Copy link
Collaborator

This PR configures the optimization.splitChunks option of webpack to split the code into smaller chunks that can be loaded on demand or in parallel. This reduces the bundle size and the initial loading time of the addin. Previously, yarn start took a long time to load. After this PR, the addin will load in considerably less time.

@mohit038 mohit038 requested a review from tobiasdiez April 23, 2023 12:21
@mohit038 mohit038 added the status: needs review Pull-request that is waiting for reviews by (core) developers label Apr 23, 2023
Copy link
Member

@tobiasdiez tobiasdiez left a comment

Choose a reason for hiding this comment

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

This is a good idea. Only problem I have is to gauge the effects this has when its deployed on a real server (and not locally).

Btw, do you have any experience of using vite with react? In the vue world, its a lot quicker than webpack.

maxInitialRequests: 30,
automaticNameDelimiter: '~',
enforceSizeThreshold: 50000,
cacheGroups: {
Copy link
Member

Choose a reason for hiding this comment

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

Most of these seem to be the default values. I think its more maintainable if only non-default values are specified, or is it necessary to specify everything?

splitChunks: {
chunks: 'all',
minSize: 20000,
maxSize: 50000,
Copy link
Member

Choose a reason for hiding this comment

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

I'm a bit unsure about the maxSize. The taskpane is now split in over 100 chunks. While this is more performant during local development, I suspect this actually performs worse if you add real latency when deployed to a server. However, I'm not sure how to test it at the moment. Should we wait until I've fixed the deployment to azure (hopefully in the next few days)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs review Pull-request that is waiting for reviews by (core) developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants