Brian M Hunt
Brian M Hunt
## Complication: CommonJS + ESM To keep things simple, at least initially, I'm going to only compile ESM. Since TKO is in (very) low usage, we can aim for future...
## Exports I'm going to rely on the [`exports` field](https://nodejs.org/api/packages.html#packages_conditional_exports) of package.json to disambiguate the type to serve. On the basis that it replicates `main` and `module` properties, I'm removing...
## Package Priorities ### `index.js` as default ESM I'm exporting ESM as `src/* => dist/*` e.g. `dist/index.js` because esbuild adds `.js` extensions to the import e.g. `import { x }...
## Microtasks aside Noting the [`queueMicrotask` API](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask)
### Monorepo - https://medium.com/@NiGhTTraX/how-to-set-up-a-typescript-monorepo-with-lerna-c6acda7d4559 - https://github.com/NiGhTTraX/ts-monorepo#jest
TKO has native JSX support now. The transpiler (webpack, babel, typescript) needs to use `ko.jsx.createElement` and `ko.jsx.Fragment` for the respective React equivalents (`React.createElement` and `React.Fragment`). For example, in Babel, this...
## Note re build topology ### Lerna I tried using `lerna exec` to build all the items in order. Unfortunately that seems to fail sporadically, seemingly because learn considers devDependencies...
## Makefile meta Having tried all the above, I'm going to look at building a `.mk` file that'll be used to build dependencies in-order. It'll go something like this: 1....
I tried a DIY like this, but I think the solution might be to change `devDependencies` to `peerDependencies` (untested): ```js #!/usr/bin/env node // // Generate deps.mk, so we've a proper...
## Lerna with `peerDependencies` Unfortunately while it builds fine locally, building appears to [still be broken in CI](https://github.com/knockout/tko/runs/2700797183?check_suite_focus=true), starting with this error: > @tko/observable: > src/observable.js:7:7: error: Could not resolve...