这是indexloc提供的服务,不要输入任何密码
Skip to content

feat(examples): add dev live reload task to example-with-angular #10716

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

chris-dura
Copy link

@chris-dura chris-dura commented Jul 28, 2025

Description

I think it's a conventional development workflow to launch both the Angular app (ie, web and docs) and watch for changes in the ui module. However, the current example's watch and start tasks (which front ng build and ng serve) don't seem to work "as expected".

By default, persistent tasks in Turborepo run at the same time; however, the ng serve in the web app will fail (and doesn't "self-heal"), because the ng build command in the ui package hasn't finished generating the dist.

I first tried all the various configurations I could find to try and get the web app ng serve to properly recognize changes in the @repo/ui package and "self-heal" after the first run, for example, using path configurations in tsconfig.json, etc, but nothing seemed to work (I may be not doing it properly, as I'm not super-familiar with Angular)

I then tried some turbo.json configs, trying to use interruptible, turbo watch etc. However, there was still a problem with the first run failing.

  1. This pull-request is more of a convo starter about what the best way to provide this would be...
  2. I found the most straight-forward method was to just add a sleep before the task; however, this is obviously inelegant -- it is also not scalable, because the "self-heal" issue also seems to affect libraries dependent on other libraries, so adding sleep before EVERY dev task that has dependencies would soon run out of runway, so really, properly recognizing changes and "restarting" the task would be the appropriate way of doing it :/
  3. I wonder if there's just a simple config, perhaps in the angular.json to re-establish the "self-healing" of the ng serve that we'd see in a non-Turborepo setup
  4. Or, perhaps some specific Turbo config would accomplish it, as long as it wasn't too complicated

Testing Instructions

Running turbo run dev or turbo run dev --filter=...@repo/ui will ng build --watch the @repo/ui library, and serve the web app at localhost:4200.

Make changes to the @repo/ui library and the app should rebuild and display the changes.

@turbo-orchestrator turbo-orchestrator bot added area: examples Improvements or additions to examples needs: triage New issues get this label. Remove it after triage labels Jul 28, 2025
Copy link

vercel bot commented Jul 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 7:11pm
examples-designsystem-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 7:11pm
examples-tailwind-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 7:11pm
examples-vite-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 7:11pm

Copy link

vercel bot commented Jul 28, 2025

@chris-dura is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: examples Improvements or additions to examples needs: triage New issues get this label. Remove it after triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant