NodeJS 16.x migration

NodeJS 16.x migration

Due to it's age, NodeJS 16.x support is now being deprecated by major service providers across the web (eg Microsoft, Vercel).

16.x differs from 18.x in some key areas - thus some migration steps will be necessary when attempting to jump from Node 16.x to Node 18.x with regard to usage of the XpansionChain JS SDK.

We have published a new version (2.0.1) of the XpansionChain JS SDK which supports Node 18.x.

All @walletconnect/* dependencies removed

Due to the sunsetting of all v1 @walletconnect infrastructure and support, we have made the decision to remove all @walletconnect related functionality from the XpansionChain JS SDK.

This means that any partners using @walletconnect based functionality within the XpansionChain JS SDK will need to deprecate this functionality when migrating.

Usage with Webpack >=5.x

From 5.0 onwards, Webpack no longer provides default NodeJS polyfills. This means that you need to configure these polyfills yourself, inside of your project's webpack configuration:

// webpack.config.ts
import NodePolyfillPlugin from 'node-polyfill-webpack-plugin';

export const baseConfig: Configuration = {
    ...,
    plugins: [
        ...,
        new NodePolyfillPlugin(),
        ...
    ],
};

Usage with magic-sdk

In order to get the SDK building in modern NodeJS - we had to update the magic-sdk npm dependency from ^7.0.0 to ^18.2.1. If you have the magic-sdk installed in your project, you may need to ensure that it is upgraded to the newer version.

Usage with CRA or react-scripts projects

We experienced significant build issues trying to utilise a Node 18.x built XpansionChain JS SDK.- inside of a project utilising react-scripts (even on the latest version 5.x).

In order to move forward, we migrated this project to a simple Babel Webpack 5.x based build.

Given that the React team themselves no longer recommend usage of react-scripts (it's now in "maintenance mode") - we strongly recommend migration away from CRA and react-scripts usage.

Last updated