remix@3.0.0-alpha.4
Breaking Changes📦 remixView on GitHub →
⚠ 4 breaking✨ 8 features🔧 37 symbols
Summary
This pre-release introduces significant structural changes to `remix/data-table` exports and adds new middleware for cross-origin protection (COP) and CSRF tokens. It also updates numerous internal `@remix-run/*` dependencies.
⚠️ Breaking Changes
- The `remix/data-table/sql` export was removed. Import `SqlStatement`, `sql`, and `rawSql` from `remix/data-table` instead.
- `remix/data-table` no longer exports `QueryBuilder`. Import `Query` and `query` from `remix/data-table`, and execute unbound queries using `db.exec(...)`. `db.exec(...)` now only accepts raw SQL or `Query` values, and unbound terminal methods like `first()`, `count()`, `insert()`, and `update()` return `Query` objects instead of separate command descriptor types.
- `remix/data-table/migrations` no longer exports a separate `Database` type alias. Import `Database` from `remix/data-table` when you need the migration `db` type directly.
- The incidental `QueryMethod` type export has been removed; use `Database['query']` or `QueryForTable<table>` when you need that type shape.
Migration Steps
- If you were importing SQL utilities from `remix/data-table/sql`, change imports to use `SqlStatement`, `sql`, and `rawSql` from `remix/data-table`.
- If you were using `QueryBuilder` from `remix/data-table`, import `Query` and `query` instead, and execute unbound queries using `db.exec(...)`.
- If you relied on the `Database` type alias in `remix/data-table/migrations`, import `Database` directly from `remix/data-table`.
- If you relied on the `QueryMethod` type, use `Database['query']` or `QueryForTable<table>` instead.
✨ New Features
- `remix/data-table` now exports the `Database` class as a runtime value, usable via `new Database(adapter, options)`.
- Added `remix/auth-middleware` to re-export APIs from `@remix-run/auth-middleware`.
- Added `remix/auth` to re-export APIs from `@remix-run/auth`.
- Added `remix/cors-middleware` to re-export the CORS middleware APIs from `@remix-run/cors-middleware`.
- `remix/component` now exposes `navigate(href, { src, target, history })`, `link(href, { src, target, history })`, `run({ loadModule, resolveFrame })`, and the `handle.frames.top` and `handle.frames.get(name)` helpers.
- `remix/component/server` re-exports the SSR frame source APIs including `frameSrc`, `topFrameSrc`, and `ResolveFrameContext`.
- Added browser-origin protection middleware `remix/cop-middleware` exposing `cop(options)`.
- Added session-backed CSRF protection middleware `remix/csrf-middleware` exposing `csrf(options)` and `getCsrfToken(context)`.
Affected Symbols
remix/data-table/sqlSqlStatementsqlrawSqlremix/data-table/sql-helpersremix/data-tableDatabasecreateDatabaseQueryBuilderQueryquerydb.execdb.queryremix/data-table/migrationsQueryMethodremix/auth-middleware@remix-run/auth-middlewareremix/auth@remix-run/authremix/cors-middleware@remix-run/cors-middlewareremix/component@remix-run/componentnavigatelinkrunhandle.frames.tophandle.frames.getremix/component/serverframeSrctopFrameSrcResolveFrameContextremix/cop-middlewarecopremix/csrf-middlewarecsrfgetCsrfToken