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

Add yarn build --unsafe-partial #17316

Merged
merged 2 commits into from
Nov 8, 2019
Merged

Add yarn build --unsafe-partial #17316

merged 2 commits into from
Nov 8, 2019

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Nov 8, 2019

We normally delete the build folder when rebuilding for consistency. This can be annoying if I make a tiny scoped edit to a particular package. This is an escape hatch so I can iterate faster when I know what I'm doing.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 8, 2019

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 50925ec:

Sandbox Source
eloquent-tree-2lrir Configuration

Copy link
Contributor

@bvaughn bvaughn left a comment

Choose a reason for hiding this comment

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

Oooh this would be very nice!

I think we should still rimraf the specific sub-folders though, so they're not left in a funky state.

@sizebot
Copy link

sizebot commented Nov 8, 2019

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against 50925ec

@gaearon
Copy link
Collaborator Author

gaearon commented Nov 8, 2019

You think so? I actually like the entry point granularity.

@sizebot
Copy link

sizebot commented Nov 8, 2019

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against 50925ec

@bvaughn
Copy link
Contributor

bvaughn commented Nov 8, 2019

The case I'd like to avoid is one of us testing an outdated/unrealistic local node_module (with stuff left over in the package from a previous build).

So e.g.

yarn build -- react,react-dom --type=NODE      

I think it would be safer to start with

 rm -rf build/node_modules/react
 rm -rf build/node_modules/react-dom

But I agree with the idea of not rm -rf build because that makes it much slower to incrementally test things locally.

Maybe the thing I'm really concerned about is the (unlikely) case that any of us would actually publish to NPM after a partial build- which could be problematic even if we were clearing the package sub-folders, so I dunno...

@gaearon
Copy link
Collaborator Author

gaearon commented Nov 8, 2019

Maybe I'll rename to partial-dangerous? I really don't intend this to be used widely. Only for cases where you're debugging why some prod test is failing or similar.

@gaearon
Copy link
Collaborator Author

gaearon commented Nov 8, 2019

Changed to unsafe-partial.

@gaearon gaearon requested a review from bvaughn November 8, 2019 19:19
@gaearon gaearon changed the title Add yarn build --partial Add yarn build --unsafe-partial Nov 8, 2019
Copy link
Contributor

@bvaughn bvaughn left a comment

Choose a reason for hiding this comment

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

Our codebase is a minefield, so many "unsafe" thigns 😆

¯\_(ツ)_/¯ Seems fine. Will save some time.

@gaearon gaearon merged commit 6cb6b1d into facebook:master Nov 8, 2019
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.

4 participants