This repo includes a bunch of barebones js projects across different runtimes using various tooling (e.g. webpack, vite etc.). These projects can be used to manually test whether our packages work in these environments
Note
This repo is currently WIP. It's being built out as we test
dwn-sdk-js
andweb5-js
compatibility
Note
Currently testing this branch
version in test:
0.1.0-unstable-2023-07-17-5eaa5e3
Runtime / Platform | ESM / CJS | Bundler | Working (Y/N) | Manual Setup Required? | Project |
---|---|---|---|---|---|
node v20.3.0 |
ESM | N/A | ✔️ | N | node-esm |
node v20.3.0 |
CJS | N/A | ✔️ | N | node-cjs |
Electron | CJS | electron-vite | ✔️ | Y | electron-vite |
Browser | ESM | esbuild | ✔️ | Y | browser-esbuild |
Browser | ESM | N/A | ✔️ | N | browser-nobundler-esm |
Browser | ESM | Webpack | ✔️ | Y | webpack |
Browser | ESM | Vite | ✔️ | Y | vite |
React Native | Both (ESM via Babel) | Metro | ✔️ | Y | reactnative |
Docusaurus | |||||
NextJS 2.0 |
Main process works fine.
Renderer process runs into this error
level-wrapper.ts:14 Uncaught TypeError: Level is not a constructor
at Object.<anonymous> (level-wrapper.ts:14:10)
at Generator.next (<anonymous>)
at fulfilled (time.ts:18:1)
had to manually instantiate all 3 stores and explicitly provide a level instance. Need to figure out why this is happening. maybe because it's a dynamic import
Not currently in a working state. Need to polyfill stream-browserify
and crypto-browserify
.
Had to manually configure stream-browserify
and crypto-browserify
polyfills here
Was running into this issue caused by lack of support for dynamic imports
level-wrapper.ts:14 Uncaught TypeError: Level is not a constructor
at Object.<anonymous> (level-wrapper.ts:14:10)
at Generator.next (<anonymous>)
at fulfilled (time.ts:18:1)
removing dynamic import fixed the issue.
Note this should fix the
electron-vite
issue as wellDiscuss ramifications of removing dynamic import with dwn core peeps
npm run build
currently failing. need to polyfill crypto-browserify
and stream-browserify
Fully custom setup complete with polyfills and bundling config required