You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an effort to lower complexity of our build / bundle process for the realm SDK package we'd like to explore migrating from using a bundler (we're currently using Rollup) into a pure TypeScript project (leveraging TypeScript Project References).
The immediate benefits that we expect this will bring:
Simpler tooling:
One less tool to learn when approaching the project as a new developer.
Less components to depend on (which all have their limitations and bugs that we sometimes need to work around).
Transpiling to individual files instead of a bundle would:
Enable end-users bundlers to more easily shake unused code and
We'll have source-maps and declaration maps (enabling "go to definition" to jump straight to source code) enabled by default.
Enable us to export internal entry-points to
simplify our testing by moving unit tests into our "integration tests" and run these tests of internal primitives of the SDK on all supported platforms.
allow end-users to inject their own platform specific helpers (such as using the window.fetch in an Electron renderer process, etc.)
build / publish experimental packages hooking into our internal APIs.
I attempted to do this migration as part of #5853, but hit a couple of issues that I needed to find workarounds for:
The Typescript compiler would emit .mjs files even when module was set to commonjs which would break the package upon import. I filed an issue for this, created a PR and found a temporary workaround.
Although the Jest issue is closed, I found problems from Jest lacking support of export conditions out of the box and had to implement a custom resolver. I later transitioned into exporting via a separate package in an attempt to work around this.
In an effort to lower complexity of our build / bundle process for the
realm
SDK package we'd like to explore migrating from using a bundler (we're currently using Rollup) into a pure TypeScript project (leveraging TypeScript Project References).The immediate benefits that we expect this will bring:
rollup-plugin-dts
we need to use type aliases when reexporting types through theRealm
namespace.rollup-plugin-dts
we need to co-locate the declaration of theRealm
namespace with theRealm
class and cannot move this to a separate file and leverage TypeScript "Module Augmentation".window.fetch
in an Electron renderer process, etc.)I attempted to do this migration as part of #5853, but hit a couple of issues that I needed to find workarounds for:
.mjs
files even whenmodule
was set tocommonjs
which would break the package upon import. I filed an issue for this, created a PR and found a temporary workaround.bundleDependencies
to pull @realm/network-transport (and a new@realm/binding
package) into the SDK's .tar.gz before uploading it to NPM. But this is not supported when using NPM workspaces (yet) :meow_sad: [BUG] Workspaces - bundledDependencies missing in tarball after npm pack npm/cli#3466The text was updated successfully, but these errors were encountered: