From fa4b7a1a09045012107250f0dd4a0e134ac18838 Mon Sep 17 00:00:00 2001 From: ephys Date: Sat, 9 Apr 2022 15:58:03 +0200 Subject: [PATCH] document breaking change from https://github.com/sequelize/sequelize/pull/14352 --- docs/other-topics/upgrade.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/other-topics/upgrade.md b/docs/other-topics/upgrade.md index 1e0255bb..b48a55fa 100644 --- a/docs/other-topics/upgrade.md +++ b/docs/other-topics/upgrade.md @@ -32,6 +32,28 @@ await sequelize.authenticate(); Sequelize v7 will only support the versions of Node.js that are still maintained when Sequelize 7 released, namingly version 14.17 and upwards [#5](https://github.com/sequelize/meetings/issues/5). +### Blocking access to `/lib` + +Sequelize v7 restricts which files can be imported. Going forward, the only modules which can be imported are: + +- `@sequelize/core` +- `@sequelize/core/package.json` + +Trying to import any other file, generally from `/lib`, will cause an error. +This change was made because these files were considered to be internal APIs and their behavior can drastically change from +one non-major release to the other, as long as the APIs exposed by `@sequelize/core` stay stable. + +If you need access to Sequelize's internal code, [open a feature request](https://github.com/sequelize/website/issues) describing your use case. + +As a **last** resort, you can still voluntarily choose to import our internal code by importing the `_non-semver-use-at-your-own-risk_` folder: + +```typescript +// do *not* do this unless you know what you're doing +import { Model } from '@sequelize/core/_non-semver-use-at-your-own-risk_/model.js'; +``` + +If you do that, we recommend pinning the Sequelize version your project uses as **breaking changes can be introduced in these files** in any new release of Sequelize, including patch. + ### TypeScript conversion One of the major foundational code changes of v7 is the migration to TypeScript.\