Skip to content

Conversation

BPScott
Copy link
Member

@BPScott BPScott commented Jan 21, 2019

WHY are these changes introduced?

Gotta go fast.

Previously we ran rollup for twice, but as the only thing that differs
is the output format that's not needed.

This reduces the build time by ~5.5 seconds (~15%) which is particularly nice if you spend time waiting for build-consumer to run or waiting for build.test.js to complete when running the test suite.

WHAT is this pull request doing?

Runs rollup() once, then generate both the cjs and the es-modules files from that single run.

As we're only running rollup() once we can also remove a bunch of conditionals from the config generation leading to simpler configuration

How to 🎩

  • On master, create a build output: git checkout master && mkdir master-build/node_modules/@shopify && yarn run build-consumer polaris-react/master-build
  • On this branch create a build output: git checkout run-rollup-once && mkdir new-build/node_modules/@shopify && yarn run build-consumer polaris-react/new-build
  • Compare the outputs and ensure they are the same: diff -r -u master-build new-build

Previously we ran rollup for twice, but as the only thing that differs
is the output format that's not needed.

This reduces the build time by ~5.5 seconds (~15%)
Copy link
Contributor

@amrocha amrocha left a comment

Choose a reason for hiding this comment

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

Can you run a diff of the master build and this branch's build? Seems like you changed a bunch of settings so I wanna make sure nothing unexpected happened before merging this

@BPScott
Copy link
Member Author

BPScott commented Jan 22, 2019

Can you run a diff of the master build and this branch's build?

That's what the tophat instructions do. No changes occur.

Copy link
Contributor

@amrocha amrocha left a comment

Choose a reason for hiding this comment

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

If you say you did it and no changes occured then I trust you, do you want me to tophat this as well or are you confident enough in it to merge?

@BPScott
Copy link
Member Author

BPScott commented Jan 22, 2019

I'm confident enough to merge. Thanks for the ✅

@BPScott BPScott merged commit 852cb65 into master Jan 22, 2019
@BPScott BPScott deleted the run-rollup-once branch January 22, 2019 21:09
@tmlayton
Copy link
Contributor

tmlayton commented Jan 23, 2019

Would you mind following up with an entry in the "code quality" section? While I have a very high degree of confidence this is fine, on the off chance it causes some bizarre issue we have a more easily identifiable milestone for posterity. Also, because asserting that the build is indeed unaffected is a manual process we have more expose there.

@tmlayton
Copy link
Contributor

tmlayton commented Jan 23, 2019

Gotta go fast.

Also,
tenor

@BPScott
Copy link
Member Author

BPScott commented Jan 23, 2019

Would you mind following up with an entry in the "code quality" section?

I added it into the development workflow section as part of 920, then updated it's wording in 4228813

I wanna go fast

You may also like: #920

@BPScott BPScott temporarily deployed to production January 28, 2019 16:33 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖Skip Changelog Causes CI to ignore changelog update check.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants