From 70c1e4e3ed0e4d62da434884c26aebf310d105ae Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 1 Dec 2021 14:06:05 +0100 Subject: [PATCH] move doc paragraphs around --- doc/impl-thoughts/SDK.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/impl-thoughts/SDK.md b/doc/impl-thoughts/SDK.md index 0faea2f2..e7979fd7 100644 --- a/doc/impl-thoughts/SDK.md +++ b/doc/impl-thoughts/SDK.md @@ -2,12 +2,6 @@ SDK: - we need to compile src/lib.ts to javascript, with a d.ts file generated as well. We need to compile to javascript once for cjs and once of es modules. The package.json looks like this: -we don't need to bundle for the sdk case! we might need to do some transpilation to just plain ES6 (e.g. don't assume ?. and ??) we could use a browserslist query for this e.g. `node 14`. esbuild seems to support this as well, tldraw uses esbuild for their build. - -one advantage of not bundling the files for the sdk is that you can still use import overrides in the consuming project build settings. is that an idiomatic way of doing things though? - - - ``` "main": "./dist/index.cjs", "exports": { @@ -17,6 +11,13 @@ one advantage of not bundling the files for the sdk is that you can still use im "types": "dist/index.d.ts", ``` +we don't need to bundle for the sdk case! we might need to do some transpilation to just plain ES6 (e.g. don't assume ?. and ??) we could use a browserslist query for this e.g. `node 14`. esbuild seems to support this as well, tldraw uses esbuild for their build. + +one advantage of not bundling the files for the sdk is that you can still use import overrides in the consuming project build settings. is that an idiomatic way of doing things though? + + + + this way we will support typescript, non-esm javascript and esm javascript using libhydrogen as an SDK got this from https://medium.com/dazn-tech/publishing-npm-packages-as-native-es-modules-41ffbc0a9dea