Skip to content

dayhaysoos/bundler-bonanza

 
 

Repository files navigation

Bundler Bonanza

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 and web5-js compatibility

dwn-sdk-js

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

Findings

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 well

Discuss 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 31.3%
  • Java 21.5%
  • JavaScript 17.8%
  • CSS 10.4%
  • Ruby 8.2%
  • Objective-C++ 6.4%
  • Other 4.4%