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

Implement a way to automatically rebuild components whenever typescript code is changed #332

Open
1 task done
DenisTensorWorks opened this issue Nov 27, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request never-stale

Comments

@DenisTensorWorks
Copy link
Collaborator

DenisTensorWorks commented Nov 27, 2024

Component your feature request relates to

  • Build scripts

Problem your feature solves? Please describe.
Currently whenever a user makes changes to the typescript code, the user needs to be rebuild that code and potentially any dependent libraries, this can be quite high friction to dev iteration given our monorepo has quite a few packages now.

It would be nice to have a smoother developer iteration cycles, for example, if it could auto detect changes to any of the dependent libraries and rebuild all relevant components, something akin to:

cd ./Frontend/implementations/typescript
npm run watch

@DenisTensorWorks DenisTensorWorks added enhancement New feature or request never-stale labels Nov 27, 2024
@mcottontensor mcottontensor self-assigned this Dec 16, 2024
@mcottontensor
Copy link
Collaborator

mcottontensor commented Jan 17, 2025

Just dumping down this
https://lerna.js.org/
I haven't actually looked into it yet. Just saw mention of it and want to look into it when I get back to this task.

Same deal with https://nx.dev/

@lukehb lukehb changed the title Implement a way to automatically rebuild components whenever dependencies are changes Implement a way to automatically rebuild components whenever typescript code is changed Jan 17, 2025
@lukehb
Copy link
Contributor

lukehb commented Jan 17, 2025

Also dumping some idea here:

The high level idea is:

  • Each package has its own npm script to start the webpack dev server (that already does watching for us)

  • By creating an uber script that starts all the dev servers we should end up in a situation where you can make a change in common and it will rebuild common, all the things that depend on common, and all the things that depend on those things

It would be pretty nice in theory, basically go to repo root and run something like npm run dev

Then can just make changes wherever and things will get rebuilt.

@lukehb
Copy link
Contributor

lukehb commented Jan 17, 2025

Another thought I had that is about speeding up dev iteration:

We should ensure all our packages have a compile-dev and build-dev option that only does one of the compilation options (cjs or esm - not both). While compiling both is good for when we go to publish, for dev, we really only want one - doing both at every package in the repo makes the compilation take twice as long.

tldr; cut down iteration time by only doing half the compiling when we know we are devving.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request never-stale
Projects
None yet
Development

No branches or pull requests

3 participants