-
Notifications
You must be signed in to change notification settings - Fork 1.1k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
[CLI] Watch generated projects #1234
Comments
Closing in favor of #1259, since that issue has more detailed description. |
If it was decided we don't want to implement this at all I'm ok to close it (with a message saying that). |
This is how I
The first one ( The second approach uses the incremental compiler, but I do have to run two separate commands! (I use two terminal panes for that.) But it is certainly worthwhile: development goes much faster. Occasionally the contents of I also have a It would be great to have all (three?) tasks in one command, but at least this setup is working well for us right now. |
@joeytwiddle Projects scaffolded using the |
Yes you are right, I only tweaked the existing I would be happy to do that. But are you devs happy to add the extra Edit: Or perhaps |
I think as long as the CLI scaffolding the app gives an option to have cc: @strongloop/sq-lb-apex @strongloop/loopback-next @raymondfeng @bajtos |
I like that with To address this limitation, I am proposing to integrate
Alternatively, we can introduce a new command Either way, by exposing Regarding I don't have a strong opinion whether this solution should be Adding an option allowing users to opt-out of watch mode (and thus a dependency on nodemon) in a fashion similar to how they can opt-out of |
FWIW, I think the implementation of What I am trying to say: if we decide to use |
FWIW, auto-selection of compilation target & dist folder is no longer a problem, we have removed this feature while preparing for TypeScript Project References & Build mode - see #1803 |
This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the |
The current release of loopback seems to use As a result, I have stopped using a separate watcher, and I now do everything in one process: "prestart": "npm run build",
// Loopback's bundled start script, which does not respond to changes
"start": "node -r source-map-support/register .",
// Use start:watch instead. After a change it will trigger prestart and start
"start:watch": "nodemon -e '*' -w src -d 2 -x 'npm run start' || exit 1", This takes a few seconds to update the build and restart the server, but I find the simplicity (only needing one terminal window) is worth the price. I do the same with (Something similar might be possible with I'm also not wedded to There are also a few alternatives to nodemon, for example three were described in this 2013 Strongloop blog post. 🙂 |
@bajtos had a proposal in #1234 (comment). @raymondfeng, any thoughts on which option to adopt to go forward? Thanks. |
@dhmlau, @bajtos : As per my observation the global trends says that most of the developer use nodemon for watch configuration of their projects, Also in this particular thread and other thread related to debug and watch most of the developer found easy integration with nodemon.
in looback itself which may be a future feature with lbs' own watcher. we may put it for feature for future. |
Please note the comment above is no longer true. At the moment, @madaky I think You can also use the solution described by @joeytwiddle in #1234 (comment). I guess the next step is to decide which solution we want to promote as "the right LoopBack way" and then update our CLI project templates to setup that solution for new projects, i.e. add "start:watch" script after "start": |
Please take the decision; This issue opened in 2018! |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Description / Steps to reproduce / Feature proposal
Projects scaffolded and started using the CLI have a start script but any changes such as adding new controllers requires us to manually restart the server. This should be automated using
tsc
watch mode imo similar to how angular does it for it's projects.I would propose to even go as far as creating a
lb4 serve
/lb4 start
command similar to angular that can accomplish the watch mode for development purposes whilenpm start
can be without watch mode for use in production.Current Behavior
Restart the app manually when a new controller is added.
Expected Behavior
App restarts automatically once a new controller has been added to the project.
The text was updated successfully, but these errors were encountered: