Skip to content

Release plan for 1.0Β #11819

Closed
Closed

Description

@alumni

This plan tracks our work towards version 1.0.

We aim a release in the first half of 2026.

Plan Items

Mark Description
πŸƒ work in progress
βœ‹ blocked task
πŸ’ͺ stretch goal for this iteration

Breaking changes

Features

Technical

Documentation

Activity

  1. locked and limited conversation to collaborators on Dec 3, 2025
  2. pinned this issue on Dec 3, 2025
  3. added this to the Next Major milestone on Dec 3, 2025
  4. michaelbromley commented on Mar 13, 2026

    @michaelbromley
    Member

    TypeORM v1.0.0 Migration β€” Executive Summary

    Findings from upgrading a large NestJS+TypeORM e-commerce framework (74 entities, 152 files with TypeORM imports) to TypeORM 1.0.0-nightly.20260313.

    Upgrade Path

    • From: TypeORM 0.3.21
    • To: TypeORM 1.0.0-nightly.20260313
    • Codebase: 152 files with TypeORM imports, 74 entities, 48 services
    • Tests run: ~1,827 e2e tests across 93 suites, verified on 3 DB drivers (sqljs, PostgreSQL, MariaDB)

    Results at a Glance

    Driver Tests Passed Failed Skipped
    sqljs 1,827 1,827 0 13
    PostgreSQL 1,826 1,826 0 13
    MariaDB 1,826 1,826 0 14
    • Compilation errors: 26+ errors across 12 files β€” all mechanical renames, fixed in ~30 minutes
    • Runtime errors: 3 TypeORM-related issues found β€” all worked around (details below)
    • Test pass rate: 100% across all 3 drivers after applying workarounds

    Breaking Changes Found

    Compilation (9 categories)

    # Category Impact Severity
    1 Connection class removed Every codebase HIGH
    2 createConnection() function removed Every codebase using it HIGH
    3 connection.close() removed Every codebase HIGH
    4 connection.isConnected removed Codebases checking connection state MEDIUM
    5 "sqlite" driver type removed SQLite users MEDIUM
    6 *ConnectionOptions types renamed Users importing driver-specific types MEDIUM
    7 BaseConnectionOptions removed Users importing base options type LOW
    8 Query.parameters now optional SchemaBuilder.log() users LOW
    9 Tightened callback types (implicit any) Strict TypeScript users LOW

    Runtime (3 issues)

    # Category Impact Severity
    10 DataSource.name property removed Code reading dataSource.name gets undefined LOW-MEDIUM
    11 @nestjs/typeorm v11 incompatible All NestJS users (hard crash at startup) CRITICAL
    12 setEntityValue merge regression relationLoadStrategy: 'query' + JOIN users (silent data loss) HIGH

    Recommended Migration Guide Sections

    1. Rename Connection to DataSource (HIGH β€” everyone hits this)

    The Connection class, createConnection(), and related APIs have been removed:

    // Before
    import { Connection, createConnection } from 'typeorm';
    const conn = await createConnection(options);
    await conn.close();
    if (conn.isConnected) { /* ... */ }
    
    // After
    import { DataSource } from 'typeorm';
    const ds = new DataSource(options);
    await ds.initialize();
    await ds.destroy();
    if (ds.isInitialized) { /* ... */ }

    This is the most common change. In our codebase it accounted for the majority of the 26+ compilation errors.

    2. Replace "sqlite" with "better-sqlite3" (MEDIUM β€” SQLite users)

    The "sqlite" driver type (based on the sqlite3 npm package) has been removed from the DatabaseType union. Use "better-sqlite3" instead:

    // Before
    { type: "sqlite", database: "db.sqlite" }
    
    // After
    { type: "better-sqlite3", database: "db.sqlite" }

    3. Rename *ConnectionOptions to *DataSourceOptions (MEDIUM)

    All driver-specific options types have been renamed:

    • MysqlConnectionOptions β†’ MysqlDataSourceOptions
    • PostgresConnectionOptions β†’ PostgresDataSourceOptions
    • SqliteConnectionOptions β†’ BetterSqlite3DataSourceOptions
    • etc.

    4. DataSource.name removed (LOW-MEDIUM β€” silent breakage)

    The top-level name property no longer exists on DataSource. Code reading dataSource.name will get undefined instead of 'default'. The name is still accessible via dataSource.options.name, but there is no implicit 'default' fallback:

    // Before
    const name = dataSource.name; // 'default'
    
    // After
    const name = dataSource.options.name ?? 'default';

    This is a silent breakage β€” no compilation error, no runtime crash. Code that branches on the connection name (e.g. multi-tenancy setups, logging) will silently misbehave.

    5. Query.parameters is now optional (LOW)

    The parameters field on the Query type returned by SchemaBuilder.log() is now optional. Code accessing query.parameters without a null check will need updating.

    Ecosystem Compatibility

    @nestjs/typeorm v11 β€” CRITICAL BLOCKER

    @nestjs/[email protected] is not compatible with TypeORM v1.0.0. It attempts to register the removed Connection class as a NestJS provider, causing a hard crash at application startup:

    TypeError: Cannot read properties of undefined (reading 'name')
        at TypeOrmCoreModule.createConnectionProvider (typeorm-core.module.js)
    

    This is the #1 blocker for TypeORM v1.0.0 adoption. NestJS is one of the largest TypeORM consumers, and every NestJS+TypeORM project will hit this on day one. A new version of @nestjs/typeorm that drops the Connection provider is needed before v1.0.0 can be adopted.

    Workaround: Patch @nestjs/typeorm's typeorm-core.module.js to guard Connection registration:

    // Before
    { provide: typeorm_1.Connection, useExisting: typeorm_1.DataSource }
    // After
    ...(typeorm_1.Connection ? [{ provide: typeorm_1.Connection, useExisting: typeorm_1.DataSource }] : [])

    setEntityValue merge regression β€” HIGH (silent data loss)

    Commit 2d8c5158d (#11267) changed RelationMetadata.setEntityValue() to merge instead of replace when the target property already holds an object. However, OrmUtils.mergeDeep delegates to OrmUtils.merge, which checks isPlainObject() β€” and entity class instances fail this check (their constructor !== Object). The merge is therefore a complete no-op for entity instances.

    What breaks: When using relationLoadStrategy: 'query', TypeORM loads relations via separate queries after the main query. If the same relation was also populated by a JOIN in the main query (e.g. via innerJoinAndSelect), the query-strategy-loaded entity (which includes eager sub-relations) should overwrite the JOIN-loaded one (which doesn't include eager sub-relations). In v1, the overwrite silently fails, and the stale, incomplete entity is kept.

    // This pattern breaks in v1:
    queryBuilder
      .setFindOptions({
        relations: ['author'],        // loaded via query strategy (with eager sub-relations)
        relationLoadStrategy: 'query'
      })
      .innerJoinAndSelect(            // also loaded via JOIN (without eager sub-relations)
        'post.author', 'author',
        'author.id = :authorId', { authorId }
      );
    
    // Expected: author loaded by query strategy (complete, with eager relations) wins
    // Actual (v1): author loaded by JOIN (incomplete, missing eager relations) is kept

    Impact: Any codebase that combines innerJoinAndSelect with relationLoadStrategy: 'query' for the same relation may silently lose eager sub-relation data. This is particularly dangerous because it produces no errors β€” the relation appears to be loaded, but nested eager relations are missing.

    Workaround: Avoid combining innerJoinAndSelect with relationLoadStrategy: 'query' for the same relation. Either:

    • Use innerJoin (without Select) so the relation isn't hydrated by the JOIN, or
    • Use the default 'join' load strategy instead of 'query'

    Suggested fix: The merge-vs-replace change in setEntityValue should be reverted or scoped more narrowly. The query strategy code path needs to replace the existing value, not merge into it. Options:

    1. Revert commit 2d8c5158d and find a more targeted fix for fix: prevent eager-loaded entities from overwriting manual relationsΒ #11267
    2. Add a replace flag to setEntityValue and use it in the query strategy code path

    Overall Assessment

    The TypeORM v1.0.0 migration is straightforward for compilation fixes β€” all changes are mechanical renames that can be automated with find-and-replace or a codemod. After fixing compilation errors, 100% of e2e tests pass across all 3 database drivers (sqljs, PostgreSQL, MariaDB) with only two runtime workarounds needed.

    Two issues require attention before v1.0.0 release:

    1. @nestjs/typeorm ecosystem dependency β€” NestJS is one of the largest TypeORM consumers, and @nestjs/typeorm@11 will crash with TypeORM v1.0.0. Coordinating a compatible release is essential for a smooth v1.0.0 launch.

    2. setEntityValue merge regression (commit 2d8c5158d) β€” The change to merge instead of replace is a no-op for entity class instances and breaks relationLoadStrategy: 'query' when combined with JOINs. This causes silent data loss and should be reverted or scoped more narrowly before release.

    Neither issue is insurmountable. The compilation migration path is clean and well-defined, and the runtime behaviour is highly compatible. With these two issues addressed, TypeORM v1.0.0 should be a smooth upgrade for most codebases.

  5. unpinned this issue on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions