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 depends on common packages #13020

Merged
merged 1 commit into from
Jun 11, 2018
Merged

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Jun 11, 2018

This adds common dependencies to scheduler.

  • fbjs avoids duplication of invariant/warning between React and the scheduler package. This fixes the FB bundle too so that it doesn't ship a different invariant than the one we use normally.
  • object-assign is not currently used but it will be if we add an Object.assign() call. In that case, if we don't specify it in dependencies, the polyfill will be inlined (which we don't want).

We can choose to drop these dependencies later by removing their use, but seems safer to add them now as we're not focused on the code size yet, and React already uses both of them anyway.

Test plan: yarn build scheduler --type=NODE,FB shouldn't include invariant or warning implementations in any bundles.

@pull-bot
Copy link

Details of bundled changes.

Comparing: ec60457...9f275d6

react-scheduler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-scheduler.development.js -25.6% -25.3% 18.98 KB 14.11 KB 5.7 KB 4.25 KB NODE_DEV
react-scheduler.production.min.js -15.2% -12.9% 3.25 KB 2.76 KB 1.55 KB 1.35 KB NODE_PROD
ReactScheduler-dev.js -26.3% -26.1% 19.15 KB 14.11 KB 5.77 KB 4.26 KB FB_WWW_DEV
ReactScheduler-prod.js -10.0% -11.4% 8.46 KB 7.62 KB 2.32 KB 2.06 KB FB_WWW_PROD

Generated by 🚫 dangerJS

Copy link
Contributor

@flarnie flarnie left a comment

Choose a reason for hiding this comment

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

goodcatchcat

@flarnie
Copy link
Contributor

flarnie commented Jun 11, 2018

Agreed - will try to remove those dependencies later, but for now this makes sense.

@gaearon gaearon merged commit 1594409 into facebook:master Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants