Skip to content

Files

Latest commit

 

History

History
53 lines (34 loc) · 1.91 KB

DEVELOPMENT.md

File metadata and controls

53 lines (34 loc) · 1.91 KB

Development

Toolchain

  • Pure ESM Module toolchain

  • Web Test Runner for test execution

    Runs ESM files in a browser using Mocha)

  • Web Test Server for running the application during development

    Serves ESM files and provides Hot Module Reload (HMR)

  • TypeScript for catching obvious errors at compile time.

    When run with --watch, usually compiles within less than a second, putting it en par with swc and esbuild in regards to performance while also providing newest language features. (E.g. 'override')

  • ttypescript to compile directly to ESM

  • rollup.js for production bundling

I usually run all tools in watch mode for best performance. Each of them in a separate terminal window.

Coding

     npm run dev:build
     npm run dev:serve

Testing

    npm run dev:build
    npm run dev:test

or when focusing on a certain feature

    npm run dev:build
    npm run dev:test --file=build/test/unit/pentool.spec.js

As workflow is developed along with toad.js and corba.js, I sometimes use them via npm link toad.js corba.js and also compile them with npm run dev:build, which will instantly reflect in dev:serve and dev:test.

Caveats

Well, reacting instantly on changes sometimes takes a few seconds for @web/* to reload while tcs really reacts instantly.

@web/test-runner sometimes also hangs for several minutes and cannot be stopped with Ctrl+C.

It would also be nice being able to run ttsc, @web/dev-server and @web/test-runner in a single terminal. But the way they print to the console doesn't make this feasible.