Remix Framework

2.17.4 · active · verified Sat Apr 18

Remix is a full-stack web framework for building better websites with a focus on web standards and modern user experience. The current stable version is 2.17.4. Recent releases indicate a move towards version 3 with significant architectural changes, particularly in data handling and request context management, which are being rolled out through alpha versions and updates to core sub-packages like `session-middleware` and `fetch-router`.

Common errors

Warnings

Install

Imports

Quickstart

This example demonstrates defining a SQL statement using the `SqlStatement` and `sql` template literal tag from `remix/data-table`. This API is part of the new data layer introduced in Remix v3, allowing for type-safe SQL query construction.

import { SqlStatement, sql } from 'remix/data-table';

interface User {
  id: string;
  name: string;
}

async function getUsersQuery(nameFilter?: string): Promise<SqlStatement<User[]>> {
  let query = sql`SELECT id, name FROM users`;
  if (nameFilter) {
    query = sql`${query} WHERE name = ${nameFilter}`;
  }
  return query as SqlStatement<User[]>;
}

async function runExample() {
  // In a real app, this would be executed by a Database adapter.
  const statement = await getUsersQuery('Alice');
  console.log('Generated SQL:', statement.sql);
  console.log('Parameters:', statement.params);
}

runExample();

view raw JSON →