mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 03:35:49 +00:00
feat: isomorphic sockets and use eventemitter3 (#2514)
Reduces filesize by 3kb minified and gzipped or 2.8% and reduces bundler
config steps.
- Move `WSWrapper` to `@xrpl/isomorphic` to remove the need to add
mapping of `ws` to `WSWrapper` file in bundler configs
- Switch to `eventemitter3` which is smaller than `events` by almost
1kb and will not require a mapping to node's `events` in `vite`
bundling. `webpack` always automatically maps it.
- max listeners is not a thing for `eventemitter3` so we do not
need to set it to `Infinity`. `ws` uses the native event emitter which
does still need that to be set.
- Remove `eventemitter2` which was only used in tests and was replaced
with `eventemitter3`
BREAKING CHANGE: Config for frontend bundlers has changed for `ws`.
This commit is contained in:
@@ -10,11 +10,5 @@ module.exports = merge(getDefaultConfiguration(), {
|
||||
library: 'xrpl',
|
||||
path: path.join(__dirname, 'build/'),
|
||||
filename: `xrpl.default.js`,
|
||||
},
|
||||
plugins: [new webpack.NormalModuleReplacementPlugin(/^ws$/, './WSWrapper')],
|
||||
resolve: {
|
||||
alias: {
|
||||
ws: './dist/npm/client/WSWrapper.js',
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user