Skip to content

Commit

Permalink
document breaking change from sequelize/sequelize#14352
Browse files Browse the repository at this point in the history
  • Loading branch information
ephys committed Apr 9, 2022
1 parent 9b9c526 commit fa4b7a1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/other-topics/upgrade.md
Expand Up @@ -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.\
Expand Down

0 comments on commit fa4b7a1

Please sign in to comment.