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

[Scheduler] Add "combined" www build #16659

Closed
wants to merge 1 commit into from

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Sep 4, 2019

The Scheduler module in www is loaded before most of our other infra: too early to conditionally load a separate build in production versus development. Which means we're currently sending both a prod and dev bundle to every single user.

We should fix this on the Facebook infra side, but in the meantime, this updates the build script to generate a new type of bundle, FB_WWW_COMBINED, which preserves DEV conditions.

The Scheduler module in www is loaded before most of our other infra:
too early to conditionally load a separate build in production versus
development. Which means we're currently sending both a prod and dev
bundle to every single user.

We should fix this on the Facebook infra side, but in the meantime, this
updates the build script to generate a new type of bundle,
`FB_WWW_COMBINED`, which preserves __DEV__ conditions.
@acdlite
Copy link
Collaborator Author

acdlite commented Sep 4, 2019

I should add more context — we don't actually use DEV checks in the Scheduler package currently. We could load the dev bundle in both dev and prod. However, that might not always be the case, so I've opened this PR as a suggestion for how to handle this if it comes up in the future.

@sizebot
Copy link

sizebot commented Sep 4, 2019

Details of bundled changes.

Comparing: f705e2b...e1aefad

scheduler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
Scheduler-combined.js n/a n/a 0 B 31.4 KB 0 B 7.88 KB FB_WWW_COMBINED
scheduler-unstable_mock.development.js 0.0% -0.0% 21.93 KB 21.93 KB 5.07 KB 5.07 KB NODE_DEV
scheduler-tracing.development.js 0.0% -0.1% 11.72 KB 11.72 KB 3.03 KB 3.03 KB NODE_DEV
scheduler-unstable_mock.production.min.js 0.0% -0.1% 4.72 KB 4.72 KB 1.92 KB 1.92 KB NODE_PROD
scheduler-tracing.production.min.js 0.0% 🔺+0.5% 728 B 728 B 381 B 383 B NODE_PROD
scheduler-tracing.profiling.min.js 0.0% -0.3% 3.25 KB 3.25 KB 991 B 988 B NODE_PROFILING
scheduler.development.js 0.0% -0.0% 31.26 KB 31.26 KB 7.88 KB 7.88 KB NODE_DEV
SchedulerMock-combined.js n/a n/a 0 B 22.22 KB 0 B 5.11 KB FB_WWW_COMBINED
scheduler-unstable_mock.development.js 0.0% -0.0% 22.12 KB 22.12 KB 5.13 KB 5.13 KB UMD_DEV

Generated by 🚫 dangerJS against e1aefad

@bvaughn
Copy link
Contributor

bvaughn commented Sep 4, 2019

Maybe we should just add a lint check that fails if we ever add a DEV check to the scheduler package.

bundleType === FB_WWW_PROD ||
bundleType === FB_WWW_PROFILING
) {
if (bundleType === FB_WWW_COMBINED) {
Copy link
Contributor

@trueadm trueadm Sep 5, 2019

Choose a reason for hiding this comment

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

Why did you remove the other two bundleTypes here (FB_WWW_DEV and FB_WWW_PROD)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because the purpose of the combined bundle is to replace the dev and prod bundles with a single bundle that includes both code paths

acdlite added a commit to acdlite/react that referenced this pull request Sep 11, 2019
Our infra currently doesn't support loading a separate profiling
build of Scheduler. Until that's fixed, the recommendation is to load
a single build and gate the profiling feature behind a flag.

Alternative to facebook#16659
acdlite added a commit to acdlite/react that referenced this pull request Sep 11, 2019
Our infra currently doesn't support loading a separate profiling
build of Scheduler. Until that's fixed, the recommendation is to load
a single build and gate the profiling feature behind a flag.

Alternative to facebook#16659
acdlite added a commit to acdlite/react that referenced this pull request Sep 11, 2019
Our infra currently doesn't support loading a separate profiling
build of Scheduler. Until that's fixed, the recommendation is to load
a single build and gate the profiling feature behind a flag.

Alternative to facebook#16659
acdlite added a commit that referenced this pull request Sep 11, 2019
Our infra currently doesn't support loading a separate profiling
build of Scheduler. Until that's fixed, the recommendation is to load
a single build and gate the profiling feature behind a flag.

Alternative to #16659
@necolas necolas added the React Core Team Opened by a member of the React Core Team label Jan 8, 2020
@acdlite
Copy link
Collaborator Author

acdlite commented Jan 23, 2020

Outdated. Worked around this in www.

@acdlite acdlite closed this Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants