Hot on the heels of the 3.0.0 major rewrite come some major changes, along with a whole host of quality of life improvements.
What has changed?
Major/Breaking Changes
- Upgrade Typescript to 5.0. This is part of the ongoing progress and preparation for ES Decorators rolling out for every touch point (waiting on Parameters)
- CLI / App Overhaul. This is a breaking changes that most people will not notice. The TL;DR is that @travetto/app is no more, and it's functionality has been merged into @travetto/cli. This means that instead of making custom @App entry points, you would create a new CLI target using the @CliCommand decorator. This also means that custom CLI commands creation has been simplified as the module now handles binding cli command flags to the class with the full support of the @travetto/schema functionality. This also applies to the main command args. The end result is that the sum of both modules is now greater than their individual parts.
- CLI / Repo Tooling Certain commands built into the @travetto/cli module were monorepo specific and the naming did not reflect that. These commands (`exec`, `version`, `list`) have all been moved to the @travetto/repo module and are now prefixed with `repo:`, (`repo:exec`, `repo:version`, `repo:list`). Additionally, the Cli is now invokable from sub folders where a package.json is not available.
- Compiler Cleanup. The new compiler introduced in 3.0.0 is fantastic, but ran into some scenarios in which some processes were continuing to run, even after the parent compiler process exited. In conjunction with stability changes, the compiler was also modified to expose progress via an IPC channel if desired. This allows external tools to better integrate with the compiler as well. Additionally, the terminal package received certain enhancements that better deal with narrow terminals, as well as scenarios that CTRL+C was not working properly.
- VSCode Upgrades. The plugin has been upgraded in line with all the above changes (App/Cli and Compiler upgrades). This should result in a better experience, along with more control and feedback on asynch processes.
- Manifest/Pack isolation. Pack now produces less files, and the manifest has been enhanced to contain additional context needed. Package.json files will no longer be read at runtime (only during manifesting). The result here is a more portable output, and the removal of node_modules in the output format.
- DI Integration with 3rd Party Code. The di module now supports the ability to declare and inject third-party code as dependencies. There are some limitations with code that is not framework-first, but in general this makes it much easier to integrate libraries and declare injectable components.
Whats Next?
The code will run through a few minor releases for stability, but hopefully this release can sit for a while as this is has been a pretty substantial investment. That being said, the short list of what's next are still in line with the previous release's future looking goals:
Heap Snapshotting
With the ESM support on the horizon (and the impact it has on unloading modules at runtime), there is real impact on the testing framework performance. With the ongoing work for heap snapshot support in V8/NodeJS, this opens the door for minimizing the performance issues, while dramatically simplifying the testing/loading code.
ES Decorators
As stated above, the expectation is that the full ES Decorator proposal will land by end of this year. This should be a pretty minor change within the framework, but will produce much cleaner output with much less dependency on tslib. With the full ES Decorator propsal implemented, the framework will also be able to leverage functions as first class citizens. This should allow for less code in situtations where the wrapping class was unnecessary.