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

Support tsx/typescript/sage run with nodemon entrypoint #442

Open
zepumph opened this issue Nov 13, 2024 · 4 comments
Open

Support tsx/typescript/sage run with nodemon entrypoint #442

zepumph opened this issue Nov 13, 2024 · 4 comments

Comments

@zepumph
Copy link
Member

zepumph commented Nov 13, 2024

From phetsims/chipper#1525, @samreid and I noticed that perennial code can be imported from app.js via nodemon instead of node. sage run doesn't support this right now, and so we would need to figure this out before we can go all in on typescript in perennial/js/common. We pinged @jbphet for consult, and are creating this issue as to not block 1525 more generally.

@zepumph zepumph self-assigned this Nov 13, 2024
@zepumph
Copy link
Member Author

zepumph commented Nov 13, 2024

Ok. From brief conversation with @jbphet on slack we went ahead and converted this usage from nodemon to node (via sage run).

Totally happy to revert, but I just wanted to formalize my idea. If we are good to proceed with this, likely deleting the "dev-node" script and just using start-node will be best.

@jbphet, let us know what you think, and if you want to meet to chat about it.

@jbphet
Copy link
Contributor

jbphet commented Nov 15, 2024

@zepumph - When you asked me about this over Slack I was getting ready for another meeting and didn't have time to give it much thought. Honestly, I'd forgotten what nodemon was all about. I just refreshed my memory (thanks Google), and it was being used here because it enables hot reloads of code changes when debugging Rosetta. I believe that this capability could still be quite useful when working on improvements to Rosetta, since it does take a fairly long time to rebuild and start up.

That being said, I certainly don't want this to block progress on phetsims/chipper#1525. In the opening comment for this issue you said, "sage run doesn't support this right now". Might it be possible to support it in the future? If so, I'd propose that we log some sort of error message for now if this is attempted, and schedule the work to add support for this sometime in the next few months. It's not urgent at the moment, since there aren't any currently scheduled improvements to Rosetta on the docket, but I'd also like to have this capability if and when some changes are scheduled.

@jbphet jbphet assigned zepumph and unassigned jbphet Nov 15, 2024
@zepumph
Copy link
Member Author

zepumph commented Nov 15, 2024

Sounds good and reasonable. I'll look into it.

@zepumph
Copy link
Member Author

zepumph commented Nov 15, 2024

Perhaps we can use nodemon as the runnable still

https://stackoverflow.com/questions/37979489/how-to-watch-and-reload-ts-node-when-typescript-files-change

nodemon --watch "src/**" --ext "ts,json" --ignore "src/**/*.spec.ts" --exec "ts-node src/index.ts"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants