> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 5.0 to 5.1

Like the migration from [Atoti UI 4.3 to 5.0](https://docs.activeviam.com/data-visualization/atoti-ui/5.2/releases-and-upgrades/migration-guide/4.3-to-5.0.md), migrating from 5.0 to 5.1 includes two parts:

* content migration
* code migration

## Content migration

This handles migrating all the content saved using older versions of Atoti UI.
This content is saved on the [Content Server](https://assets.activeviam.com/products/atoti/server/6.0.0/docs/content_server/cs_overview/), and includes dashboards, widgets, filters, etc.

We provide a command-line interface to migrate it: [atoti-ui-migration](https://github.com/activeviam/atoti-ui-migration).

You will find all the necessary instructions in its [README](https://github.com/activeviam/atoti-ui-migration#atoti-ui-migration).

## Code migration

The minimum version of Node.js required to use `@activeviam/activeui-scripts`, `@activeviam/content-server-initialization`, and the other `@activeviam/*` packages running on Node.js has been bumped to 18.12.1. Upgrade your Node.js version if you have an older one.

### Peer dependencies

The following peer dependency versions are required:

* [`react`](https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html): ^18.0.0. Just bumping the version in your `package.json` should be enough.
* [`antd`](https://ant.design/docs/react/migration-v5): ^5.1.0. Follow the instructions in the link, and in particular make sure that you change the import syntax as follows:

```diff theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
- import Button from "antd/lib/button";
+ import { Button } from "antd";
```

### @activeviam/activeui-sdk breaking changes

Please refer to the "Removed" and "Changed" sections of the [changelog](https://assets.activeviam.com/products/atoti/ui/5.1/docs/changelog/#510).

### ESM only

`@activeviam`-scoped packages are ESM only now, as it is the [official standard format](https://tc39.es/ecma262/#sec-modules) to package JavaScript code.
No CJS version is exposed anymore.

This should be seamless to build and run Atoti with extensions.

However, note that if you are using the [`Jest`](https://jestjs.io) library for testing, you might encounter errors while running your tests.
If you do, consider adapting your configuration as described in the Jest docs.

Here is an example `jest.config.js` file:

```javascript theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
const extensions = ["js", "jsx", "ts", "tsx", "mjs", "json"];

const esmPackages = [
  "@activeviam/*",
  "lodash-es",
  "react-dnd",
  "dnd-core",
  "@react-dnd",
  "monaco-editor",
];

module.exports = {
  testEnvironment: "jsdom",
  transform: {
    "^.+\\.[jt]sx?$": [
      "@swc/jest",
      {
        jsc: {
          transform: {
            react: {
              runtime: "automatic",
            },
          },
        },
      },
    ],
  },
  transformIgnorePatterns: [
    // Transpiling ESM packages to CJS because Jest doesn't support ESM fully yet.
    // See https://jestjs.io/docs/en/ecmascript-modules.
    `[/\\\\]node_modules[/\\\\](../../?!${esmPackages.join(
      "|",
    )}).+\\.(${extensions.join("|")})$`,
  ],
};
```

Note that this transpilation relies on [`@swc/jest`](https://swc.rs/docs/usage/jest), that you can install with:

```bash theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
npm add -D @swc/core @swc/jest
```

Unrelated to the transpilation, but also note that `testEnvironment: "jsdom"` is used to run tests in a browser-like environment.
To use it, you need to install [`jest-environment-jsdom`](https://www.npmjs.com/package/jest-environment-jsdom):

```bash theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
npm add -D jest-environment-jsdom
```

### Miscellaneous

The `@activeviam/atoti-ui-sdk-scripts` package is not published anymore.
It was always meant for internal use only, but if you happen to use it, here is how you can replace it:

* `atoti-ui-sdk-scripts build` => [`tsc --build`](https://www.typescriptlang.org/docs/handbook/compiler-options.html) (the TypeScript compiler) if you are using TypeScript. You can remove the script otherwise.
* `atoti-ui-sdk-scripts start` => `tsc --watch` if you are using TypeScript. You can remove the script otherwise.
* `atoti-ui-sdk-scripts test` => [`jest`](https://jestjs.io/docs/cli) (the [Jest](https://jestjs.io) CLI). Refer to the section above if you need to adapt the Jest config.
* `atoti-ui-sdk-scripts lint` => [`prettier`](https://prettier.io/docs/en/options.html) (the [`Prettier`](https://prettier.io/) CLI) and [`eslint`](https://eslint.org/docs/latest/use/command-line-interface) (the [ESLint](https://eslint.org/) CLI).
