Consolidate the build process to a single build tool
Modernization of the Build System: While great strides have been made in upgrading the stack from Webpack 4 to Webpack 5 (see, for example, stellar-base#584), there’s still much more to be done. There are far superior build systems out there today that will lead to smaller and faster bundle sizes for downstream systems. We can also make the effort to support a newer package manager, like modern npm or Yarn 3.
This may or may not require downstream systems to also adapt to the new build system.
- [x] remove axios - ready for review
- [x] eventSource - ready for review
- [x] react-native - testing framework needs more research (node pkg to remove some packages for non-browser)
Tree shaking is most likely build in according to @BlaineHeffron. Disable axios for node will be done through tree shaking
React native requires a workaround even if you use the no-eventsource version of the SDK. Here is what worked for me:
in the metro config:
let blacklistedModules = ["eventsource"];
resolver: {
resolveRequest: (context, moduleName, platform) => {
if (blacklistedModules.includes(moduleName)) {
return {
filePath: path.resolve(__dirname + "/empty-module.js"),
type: "sourceFile"
};
} else {
return OriginalResolver.resolve(
{ ...context, resolveRequest: undefined },
moduleName,
platform
);
}
}
}
Create a blank file empty-module.js.
The no-eventsource and no-axios versions were merged in https://github.com/stellar/js-stellar-sdk/pull/1066 and https://github.com/stellar/js-stellar-sdk/pull/1038
Heroic accomplishment, can be closed I think 👍
Consolidated to a single build tool is has not been completed.