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

[SDK-3943] Add some regression testing for bundle size and included files #1507

Merged
merged 5 commits into from
Nov 27, 2023

Conversation

lawrence-forooghian
Copy link
Collaborator

@lawrence-forooghian lawrence-forooghian commented Nov 17, 2023

Note: This PR is based on top of #1505; please review that one first.

This enhances the modulereport script, which gets run in CI, to do the following:

  • check which files make a non-trivial contribution to BaseRealtime bundle size (against a hardcoded allow list)
  • check that the bundle size of a minimal useful Realtime client (i.e. one that can subscribe) does not exceed a hardcoded threshold

The idea being to have some safeguards against accidental regressions in bundle size.

Resolves #1497.

@github-actions github-actions bot temporarily deployed to staging/pull/1507/features November 17, 2023 17:22 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1507/bundle-report November 17, 2023 17:23 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1507/typedoc November 17, 2023 17:23 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the 1497-regression-testing-bundle branch from 478298d to d176d34 Compare November 17, 2023 17:36
@github-actions github-actions bot temporarily deployed to staging/pull/1507/features November 17, 2023 17:36 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1507/bundle-report November 17, 2023 17:37 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1507/typedoc November 17, 2023 17:37 Inactive
@lawrence-forooghian lawrence-forooghian marked this pull request as ready for review November 21, 2023 00:21
@lawrence-forooghian lawrence-forooghian force-pushed the exclude-PresenceMessage-from-base-realtime branch from 29f876f to bd48dc8 Compare November 22, 2023 16:20
@lawrence-forooghian lawrence-forooghian force-pushed the 1497-regression-testing-bundle branch from d176d34 to b8b57ee Compare November 22, 2023 16:22
@github-actions github-actions bot temporarily deployed to staging/pull/1507/features November 22, 2023 16:22 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1507/bundle-report November 22, 2023 16:23 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1507/typedoc November 22, 2023 16:23 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the exclude-PresenceMessage-from-base-realtime branch from bd48dc8 to 954d6e7 Compare November 22, 2023 19:25
@lawrence-forooghian lawrence-forooghian force-pushed the 1497-regression-testing-bundle branch from b8b57ee to 1ed2065 Compare November 22, 2023 19:25
@github-actions github-actions bot temporarily deployed to staging/pull/1507/features November 22, 2023 19:26 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1507/bundle-report November 22, 2023 19:26 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1507/typedoc November 22, 2023 19:26 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the exclude-PresenceMessage-from-base-realtime branch from 954d6e7 to b04f03f Compare November 23, 2023 14:44
@lawrence-forooghian lawrence-forooghian force-pushed the 1497-regression-testing-bundle branch from 1ed2065 to 9e0f343 Compare November 23, 2023 14:45
@github-actions github-actions bot temporarily deployed to staging/pull/1507/features November 23, 2023 14:46 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1507/bundle-report November 23, 2023 14:46 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1507/typedoc November 23, 2023 14:46 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the 1497-regression-testing-bundle branch from 9e0f343 to b5d8fe5 Compare November 23, 2023 14:49
@github-actions github-actions bot temporarily deployed to staging/pull/1507/features November 23, 2023 14:50 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1507/bundle-report November 23, 2023 14:50 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1507/typedoc November 23, 2023 14:50 Inactive
Copy link
Member

@owenpearson owenpearson left a comment

Choose a reason for hiding this comment

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

Looks great! I'm a big fan of the test to ensure we don't accidentally re-include modules in the minimal client. The latter test I think having a static threshold is a bit arbitrary and maybe we could consider something like snapshot testing in future but it's better than nothing so happy to approve anyway

package.json Outdated Show resolved Hide resolved
@lawrence-forooghian lawrence-forooghian force-pushed the 1497-regression-testing-bundle branch from b5d8fe5 to beb1038 Compare November 24, 2023 18:29
@github-actions github-actions bot temporarily deployed to staging/pull/1507/features November 24, 2023 18:30 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1507/typedoc November 24, 2023 18:30 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1507/bundle-report November 24, 2023 18:30 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the exclude-PresenceMessage-from-base-realtime branch from b04f03f to 3b0a73e Compare November 27, 2023 13:13
@lawrence-forooghian lawrence-forooghian force-pushed the 1497-regression-testing-bundle branch from beb1038 to f8c9f3b Compare November 27, 2023 13:15
@github-actions github-actions bot temporarily deployed to staging/pull/1507/features November 27, 2023 13:15 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1507/bundle-report November 27, 2023 13:16 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1507/typedoc November 27, 2023 13:16 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the exclude-PresenceMessage-from-base-realtime branch from 3b0a73e to fd7712d Compare November 27, 2023 14:30
@lawrence-forooghian lawrence-forooghian force-pushed the 1497-regression-testing-bundle branch from f8c9f3b to 61b87ed Compare November 27, 2023 14:31
@github-actions github-actions bot temporarily deployed to staging/pull/1507/features November 27, 2023 14:31 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1507/bundle-report November 27, 2023 14:32 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1507/typedoc November 27, 2023 14:32 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the exclude-PresenceMessage-from-base-realtime branch from fd7712d to 10bac3c Compare November 27, 2023 17:46
Want to use `await` in an upcoming commit.
To give us further confidence that something unexpected won’t sneak in.

This just automates a rather crude process that I’ve been performing
manually from time to time — tweak the moduleReport script to spit out
source file + source map, then run source-map-explorer on the
output and look at which files are making a significant contribution to
the bundle size.

Part of #1497.
Another protection against regressions in bundle size.

Resolves #1497.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants