Skip to content

[Snyk] Security upgrade typeorm from 0.3.30 to 1.0.0 - #2849

Open
simlarsen wants to merge 1 commit into
masterfrom
snyk-fix-49c539afd20979c51ae0ae3016a46046
Open

[Snyk] Security upgrade typeorm from 0.3.30 to 1.0.0#2849
simlarsen wants to merge 1 commit into
masterfrom
snyk-fix-49c539afd20979c51ae0ae3016a46046

Conversation

@simlarsen

Copy link
Copy Markdown
Contributor

snyk-top-banner

Snyk has created this PR to fix 1 vulnerabilities in the npm dependencies of this project.

Snyk changed the following file(s):

  • package.json
  • package-lock.json

Vulnerabilities that will be fixed with an upgrade:

Issue
high severity Allocation of Resources Without Limits or Throttling
SNYK-JS-BRACEEXPANSION-18313044

Breaking Change Risk

Merge Risk: High

Notice: This assessment is enhanced by AI.


Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • Max score is 1000. Note that the real score may have changed since the PR was raised.
  • This PR was automatically created by Snyk using the credentials of a real user.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic


Learn how to fix vulnerabilities with free interactive lessons:

🦉 Allocation of Resources Without Limits or Throttling

@simlarsen

Copy link
Copy Markdown
Contributor Author

Merge Risk: High

The upgrade from TypeORM v0.3.30 to v1.0.0 is a major release with significant breaking changes that will require code and environment modifications. This is the first stable major release since the project began in 2016, and it modernizes the API, removes long-deprecated features, and updates platform requirements. [2, 4, 5]

Key Breaking Changes:

  • Node.js Requirement: Support for Node.js versions 16 and 18 has been dropped. TypeORM v1.0.0 requires Node.js 20 or newer, as it is compiled for ECMAScript 2023. [1, 2, 12]
  • API Removal and Renaming:
    • Connection, ConnectionOptions, and global functions like createConnection, getConnection, getManager, and getRepository have been completely removed. [2, 4] You must refactor your code to use the DataSource class for setup and all subsequent operations. [2]
    • The .connection property on classes like QueryRunner and EntityManager has been renamed to .dataSource. [2]
  • Driver Changes:
    • The mysql driver package is no longer supported; you must use mysql2. [2, 3]
    • The sqlite3 driver is replaced by better-sqlite3. [3]

Recommendation:
This is a high-impact upgrade that requires a planned migration effort. Do not merge this upgrade without performing the necessary refactoring.

  1. Use the Automated Codemod: The TypeORM team has provided a codemod tool to automate many of the required changes. Run npx @typeorm/codemod v1 src/ on your source code to handle most API renames and syntax updates. [2, 4, 12]
  2. Update Node.js: Ensure your development and production environments are running Node.js 20 or higher.
  3. Review the Migration Guide: Consult the official v1.0 Release Notes and Upgrading Guide for a detailed walkthrough of all changes. [2, 8]

Notice 🤖: This content was augmented using artificial intelligence. AI-generated content may contain errors and should be reviewed for accuracy before use.

@simlarsen

Copy link
Copy Markdown
Contributor Author

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants