Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove 3 http related polyfills #2375

Merged
merged 12 commits into from
Jul 26, 2023
15 changes: 1 addition & 14 deletions UNIQUE_SETUPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@ To use `xrpl.js` with React, you need to install shims for core NodeJS modules.
assert \
buffer \
crypto-browserify \
https-browserify \
os-browserify \
process \
stream-browserify \
stream-http \
url
stream-browserify
```

2. Modify your webpack configuration
Expand All @@ -48,11 +44,7 @@ To use `xrpl.js` with React, you need to install shims for core NodeJS modules.
Object.assign(fallback, {
assert: require.resolve("assert"),
crypto: require.resolve("crypto-browserify"),
http: require.resolve("stream-http"),
https: require.resolve("https-browserify"),
os: require.resolve("os-browserify"),
stream: require.resolve("stream-browserify"),
url: require.resolve("url"),
ws: require.resolve("xrpl/dist/npm/client/WSWrapper"),
});
config.resolve.fallback = fallback;
Expand Down Expand Up @@ -141,7 +133,6 @@ export default defineConfig({
},
optimizeDeps: {
esbuildOptions: {

define: {
global: 'globalThis',
},
Expand All @@ -165,8 +156,6 @@ resolve: {
events: 'events',
crypto: 'crypto-browserify',
stream: 'stream-browserify',
http: 'stream-http',
https: 'https-browserify',
ws: 'xrpl/dist/npm/client/WSWrapper',
},
}})
Expand All @@ -181,8 +170,6 @@ npm install --save-dev @esbuild-plugins/node-globals-polyfill \
events \
crypto-browserify \
stream-browserify \
stream-http \
https-browserify \
xrpl
```

Expand Down
76 changes: 53 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"eslint-plugin-tsdoc": "^0.2.16",
"eventemitter2": "^6.0.0",
"expect": "^29.3.1",
"https-browserify": "^1.0.0",
"jest": "^29.3.1",
"jest-mock": "^29.3.1",
"lerna": "^4.0.0",
Expand All @@ -60,12 +59,10 @@
"source-map-loader": "^4.0.1",
"source-map-support": "^0.5.16",
"stream-browserify": "^3.0.0",
"stream-http": "3.2.0",
"ts-jest": "^29.0.3",
"ts-loader": "^9.2.5",
"ts-node": "^10.2.1",
"typescript": "^5.1.6",
"url": "^0.11.0",
"webpack": "^5.81.0",
"webpack-bundle-analyzer": "^4.1.0",
"webpack-cli": "^5.0.1"
Expand Down
1 change: 1 addition & 0 deletions packages/xrpl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"bignumber.js": "^9.0.0",
"bip32": "^2.0.6",
"bip39": "^3.0.4",
"cross-fetch": "^4.0.0",
"ripple-address-codec": "^4.3.0",
"ripple-binary-codec": "^1.7.1",
"ripple-keypairs": "^1.3.0",
Expand Down
Loading