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

noahdarveau/size-limit test #2717

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

noahdarveau-MSFT
Copy link
Contributor

@noahdarveau-MSFT noahdarveau-MSFT commented Feb 6, 2025

Added a configuration to size-limit that will build with app, authentication, and pages. The size limit threshold is set to the size of these capabilities. If any of the other capabilities stop treeshaking, then the size of the build will increase above this threshold and fail the build. However, if someone is making changes to app, authentication, or pages, then they will need to adjust the size limit threshold accordingly. The size-limit step runs as part of the build step, so if there is a size issue, it will fail at build time.

@noahdarveau-MSFT noahdarveau-MSFT requested a review from a team as a code owner February 6, 2025 23:44
Copy link
Contributor

github-actions bot commented Feb 6, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
packages/teams-js/dist/esm/packages/teams-js/src/index.js 180.39 KB (0%) 3.7 s (0%) 1.9 s (+48.03% 🔺) 5.5 s

package.json Outdated
"brotli": false,
"path": "./packages/teams-js/dist/esm/packages/teams-js/src/index.js",
"import": "{ app, authentication, pages }",
"limit": "58.033 KB"
Copy link
Contributor

Choose a reason for hiding this comment

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

"limit": "58.033 KB"

Is it important that this be so tightly constrained to the current size? E.g., do we want to allow for a little bit of slack in the limit (to allow for some refactoring/etc.)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is something we could do. I ran into a bit of a problem trying to figure out how much wiggle room we should allow, that would both allow for refactoring and small changes but still catch treeshaking breakages.

@AE-MS
Copy link
Contributor

AE-MS commented Feb 7, 2025

What will the developer experience be like when someone makes a change that exceeds the limit?

Copy link
Contributor

@AE-MS AE-MS left a comment

Choose a reason for hiding this comment

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

See comments

@noahdarveau-MSFT
Copy link
Contributor Author

What will the developer experience be like when someone makes a change that exceeds the limit?

If a developer makes a change that causes the size limit to be exceeded, their build will fail with it throwing an error that the size limit has been increased. It will then be up to the developer to determine if this is a warranted size increase, and either increase the size limit accordingly or resolve the cause of the size increase.

@AE-MS
Copy link
Contributor

AE-MS commented Feb 7, 2025

What will the developer experience be like when someone makes a change that exceeds the limit?

If a developer makes a change that causes the size limit to be exceeded, their build will fail with it throwing an error that the size limit has been increased. It will then be up to the developer to determine if this is a warranted size increase, and either increase the size limit accordingly or resolve the cause of the size increase.

Do we have any control over what the message says? E.g., how will the developer know where to update the size? How will the developer know what to consider when deciding whether they've "broken" tree shaking? At the very least can we put a comment near the size definition to say "Hey if you are changing this you better be sure you didn't break tree shaking; don't just update this because your build failed. Here's a link that describes tree shaking and how you can know whether you broke it: etc. etc."

package.json Outdated Show resolved Hide resolved
@jadahiya-MSFT
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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