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 build-packages:watch script #37802

Merged
merged 1 commit into from
Nov 21, 2019
Merged

Add build-packages:watch script #37802

merged 1 commit into from
Nov 21, 2019

Conversation

nbloomf
Copy link
Contributor

@nbloomf nbloomf commented Nov 20, 2019

Changes proposed in this Pull Request

  • Adds build-packages:watch script, which uses chokidar-cli to watch and rebuild source files in packages/.
  • Includes build-packages:watch with main watcher scripts during poststart.

Testing instructions

Run npm start, then make changes somewhere in packages/

@nbloomf nbloomf requested a review from a team as a code owner November 20, 2019 20:39
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

Copy link
Member

@sirbrillig sirbrillig left a comment

Choose a reason for hiding this comment

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

Works as described. The only downside I see is that it rebuilds all of the packages if any one changes, but I'm not sure if there's an easy way around that. Maybe if we added a separate watch script for each package, but I don't know if the downside is worth that effort. 🤔 Still, I think it's better than what we have now.

@nbloomf
Copy link
Contributor Author

nbloomf commented Nov 20, 2019

it rebuilds all of the packages if any one changes

I agree this isn't ideal -- for one thing as TypeScript usage grows the cost of unnecessary tsc runs will eventually hurt. A more sophisticated script could probably handle this though; chokidar puts a stream of changed filenames on stdout, from which we could extract package names and call more specific build scripts. But as you say it's not obvious whether the added complexity is worth it right now.

@blowery
Copy link
Contributor

blowery commented Nov 20, 2019

Agreed, let's keep it fairly simple for now. Thanks for putting this together!

@blowery
Copy link
Contributor

blowery commented Nov 20, 2019

down the road, another option would be to add a watch or dev target to every package under packages and have that use the "best" method for each package. tsc already has a --watch option that we could use for typescript based packages.

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