storacha-network / w3ui

👩‍🎤 Headless, type-safe, UI components for the next generation Web3.Storage APIs.
Other
63 stars 25 forks source link

Document new API and deprecate old #592

Open alanshaw opened 7 months ago

alanshaw commented 7 months ago

In https://github.com/web3-storage/w3ui/pull/591 we switched to a new simplier API with new packages. Due to time constraints we didn't document the new packages or deprecate the old packages yet (they still work but with older versions of w3up).

cc @travis

Honour-d-dev commented 7 months ago
 ⨯ node_modules\@w3ui\react\build\esm\index.js (17:7) @ commonjsRequire
 ⨯ unhandledRejection: Error: Could not dynamically require "url". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.
    at commonjsRequire (webpack-internal:///(ssr)/./node_modules/@w3ui/react/build/esm/index.js:40:11)
    at __wbg_init (webpack-internal:///(ssr)/./node_modules/@w3ui/react/build/esm/index.js:18202:124)
    at eval (webpack-internal:///(ssr)/./node_modules/@w3ui/react/build/esm/index.js:18236:21)
    at eval (webpack-internal:///(ssr)/./node_modules/@w3ui/react/build/esm/index.js:47:9)
    at eval (webpack-internal:///(ssr)/./node_modules/@w3ui/react/build/esm/index.js:48:7)
    at eval (webpack-internal:///(ssr)/./node_modules/@w3ui/react/build/esm/index.js:29511:3)

code runs fine on the browser without errors after @rollup config but still throws on terminal and during build. this is with the new w3ui api

Honour-d-dev commented 7 months ago

its also possible i didn't do the rollup configuration right, so perhaps an example on that would be appreciated my config

import commonjs from "@rollup/plugin-commonjs";

export default {
  input: "src/index.js",
  output: {
    dir: "output",
    format: "cjs",
  },
  plugins: [
    commonjs({
      dynamicRequireTargets: ["node_modules/@w3ui/*.js"],
      ignoreDynamicRequires: true,
      strictRequires: true,
    }),
  ],
};