phetsims / chipper

Tools for developing and building PhET interactive simulations.
http://scenerystack.org/
MIT License
12 stars 14 forks source link

transpile.js should not be used. Changes to output-js grunt tasks needed. #1499

Closed zepumph closed 2 weeks ago

zepumph commented 1 month ago

We run transpile.js directly too often. There are grunt tasks that are a bit clunky, and don't support watch, like output-js, and we should make those the public api for transpilation. This is of utmost importance as it pertains to the phet codebase. This needs stability, maintainability, and discoverability. This should be a grunt task.

This issue will be informed by discussion in https://github.com/phetsims/perennial/issues/370.

We should not forget about this scary line of public doc telling everything to run a node script. How should we change that?

https://github.com/phetsims/phet-info/blob/9763f6e5b9d2e0c94cbf34d43dd80a8d6070dcda/doc/phet-development-overview.md#L116:

  • Run the TypeScript transpiler: node js/scripts/transpile.js --watch which starts a process that will auto-transpile

@samreid and I believe the best api mimics how we are setting up lint and check commands:

grunt output-js                       # transpile your repo and its dependencies (output-js-project is an alias for this).
grunt output-js --all                # transpile all active repos
grunt output-js --all --watch  # support the watch process.

the maintenance tooling uses output-js-project, so keeping that API stable is a very good idea.

Note that the implementation may change to swc in #1354 but the API is stable so nothing will change. This should block that conversion so that entry points only need to be changed once.

zepumph commented 1 month ago
zepumph commented 1 month ago

I feel like grunt output-js --watch is so weird. Maybe we can rename it to transpile without breaking the API for output-js-project. Let's ask JO.

zepumph commented 1 month ago

Alright. 10 TODOs store the main challenge of this issue. @samreid and I would also like to ask @jonathanolson tomorrow if we can rename output-js to transpile, even though we will keep output-js-project for backwards compatibility.

Everything is still on the development branches for perennial and chipper.

zepumph commented 1 month ago

I feel blocked on the rest of these items, and I believe we want want to wait until we swap out this task with SWC before continuing.

samreid commented 3 weeks ago

Note some of these are done in the patch for https://github.com/phetsims/chipper/issues/1354

samreid commented 2 weeks ago

All TODOs and checkboxes above completed. Closing.