Skip to content

Releases

GemStack 0.4.3

Choose a tag to compare

@github-actions github-actions released this 11 Oct 06:54
  • bin/deploy / gemstack deploy: runs Kamal with the root .env.production.local, .env.production
    and .env loaded (never .env.local), so .kamal/secrets resolves from the same .env as everything
    else — Kamal doesn't read .env itself. Without arguments it deploys, refusing while there are
    uncommitted changes (Kamal builds the last commit); other Kamal commands pass through
    (bin/deploy setup, bin/deploy logs). gemstack generate deploy writes bin/deploy.
  • gemstack update updates the deploy files too (Dockerfile, config/deploy.yml, .kamal/secrets,
    bin/deploy…), the same way as the app's templates: unedited files are updated, edited ones can be
    merged — starting from the exact template each was generated from, which .gemstack/generators.json
    records — and files a release adds (bin/deploy) are created. Before, deploy files never got a
    release's fixes after gemstack generate deploy.
  • gemstack generate deploy: the api role is the primary role, so it boots before the web role, whose
    health check renders pages that call the API (the first deploy could fail before); the web role enables
    kamal-proxy explicitly. config/deploy.yml shows how to serve www and the bare domain and to set the
    SSH user, .kamal/secrets how to use GitHub's registry; the generator says to run
    bundle lock --add-checksums when Gemfile.lock lists gem checksums. The deployment guide covers these
    and adding your own settings.

GemStack 0.4.2

Choose a tag to compare

@github-actions github-actions released this 06 Oct 13:02
  • gemstack update: files you edited that the release also changed can be merged — [m]erge keeps
    your edits and applies the release's template changes on top (three-way, git merge-file), with conflict
    markers only where both changed the same lines. Before, the choices were overwrite (losing your edits),
    skip, diff or save as FILE.new.

GemStack 0.4.1

Choose a tag to compare

@github-actions github-actions released this 06 Oct 12:23
  • One .env for the API and the frontend: the root one. frontend/lib/gemstack/root-env.cjs loads the
    root .env files for Next.js (same order as the API, real environment first): next.config.ts requires
    it, so next dev, next build and next start get the values wherever they run, and the standalone
    server preloads it (npm run start:standalone, i.e.
    node -r ./lib/gemstack/root-env.cjs .next/standalone/server.js). Before, a production build outside
    gemstack dev compiled NEXT_PUBLIC_* values in as undefined, and the standalone server's server-side
    code only saw real environment variables. The API now loads the root .env files in production too, when
    present (real environment variables still win). The Docker image built by gemstack generate deploy gets
    the root .env's NEXT_PUBLIC_* lines as a build secret for next build (.kamal/secrets:
    GEMSTACK_PUBLIC_ENV), never stored in the image, and its web command preloads the loader too. Existing
    apps: gemstack update adds the loader and updates next.config.ts and package.json; re-run
    gemstack generate deploy for the Docker/Kamal part.

GemStack 0.4.0

Choose a tag to compare

@github-actions github-actions released this 06 Oct 11:44

Upgrading from 0.3.x: run gemstack update (it also updates the files gemstack new wrote). Apps that
added realtime: copy frontend/lib/gemstack/realtime.ts from a fresh gemstack add realtime for
WebSockets, realtime.send, presence and the offline status — the old client keeps working over
Server-Sent Events. Validation error messages now list the failures (the errors hash is unchanged).

  • Model enums: enum :status, %w[draft published archived], default: "draft" — a string column
    limited to those values, validated, accepted only with those values by the request schema, typed
    "draft" | "published" | "archived" in TypeScript and OpenAPI, with Product.statuses, draft?,
    published! and chainable Product.published (prefix: for clashes). Generators take
    status:enum:draft,published,archived (migration column, the enum line, a <select> in the form).
    Schemas and fields take enum: too.
  • Validation errors say what failed in their message — "Validation failed: price must be greater than 0" —
    not only in errors, and generated forms show the message when an error belongs to no field in the form
    (e.g. errors.add(:base, …)); before, such errors left the form without any message.
  • Realtime runs over WebSockets. gemstack add realtime gives one WebSocket per browser tab on
    /api/realtime (same origin; the dev gateway and kamal-proxy route it with /api), carrying
    subscriptions, broadcasts, browser → server messages (realtime.send → receive in
    config/channels.rb, with replies), presence (channel "rooms:*", presence: true, usePresence,
    GemStack::Realtime.present_on), connection identity (identify) and replay after reconnects. The
    browser client reconnects with backoff, resubscribes and de-duplicates; Origins are checked and
    messages are size- and rate-limited. GemStack.broadcast, channel rules and brokers are unchanged.
  • Server-Sent Events are a full second transport with the same features (receive via POST,
    presence, identity, replay). config.realtime.transports (default [:websocket, :sse]) says what the
    server accepts; NEXT_PUBLIC_GEMSTACK_REALTIME (auto — the default: WebSocket, falling back to SSE when
    one can't be opened — websocket or sse) what the browser uses. App code is the same either way.
    useRealtimeStatus() adds offline (the browser lost its network), realtime.transport says which one
    is in use, and presence survives a reconnect within config.realtime.presence_grace (3 s). Apps on the
    old realtime.ts keep working; copy the new client to get the rest (docs/realtime.md).
  • GemStack::Auth.user_from(request): the signed-in user outside controllers (session cookie or API
    token), e.g. for realtime's identify.
  • Background jobs work from gemstack new: apps with a database get the jobs table, gemstack new
    migrates, and gemstack dev runs a worker from the first run. Jobs still run only via perform_later.
  • New apps include gem "brotli", so responses are Brotli-compressed for browsers that accept it
    (gzip otherwise; compression was already on by default).
  • PostgreSQL is the recommended production database: config/database.yml, the Kamal config and
    gemstack doctor --production say how to use it (DATABASE_URL). SQLite stays the development default.
  • GemStack now describes itself as "a fast, modular Ruby web application framework with a Next.js frontend"
    (README, gem READMEs and the gem summary on rubygems.org).

GemStack 0.3.6

Choose a tag to compare

@github-actions github-actions released this 05 Oct 11:18
  • gemstack update updates the app's templates too. After moving the gems, it brings the files
    gemstack new wrote (config, bin/, frontend setup, …) up to the new version, comparing your copy with
    the old and the new version's templates: files the release didn't change are left alone, new files are
    created, files you never edited are updated, and for files you edited you choose — overwrite, skip, see
    the diff, or save the new version as FILE.new (never overwritten without asking; scripts get a list).
    gemstack update --templates [--from VERSION] [--dry-run] runs that step alone. Apps record the
    templates they're on in .gemstack/version (new apps from this release; older apps are compared with
    the version in their Gemfile.lock).
  • gemstack destroy reverses every generator: besides resources, models and controllers it now removes
    jobs, policies, migrations (same safety rules: only pending, uncommitted ones unless
    --remove-migrations) and the Kamal deploy files (gemstack destroy deploy, which also removes the
    kamal Gemfile line it added). Jobs and policies still named elsewhere in the app are refused; shared
    files such as application_job.rb and the jobs table migration are kept. Code from these generators is
    tracked from this release on.

GemStack 0.3.5

Choose a tag to compare

@github-actions github-actions released this 05 Oct 09:51
  • gemstack generate deploy now sets up Kamal instead of docker compose and
    Caddy: one production image for every process, config/deploy.yml with web, api and jobs roles
    (kamal-proxy serves one origin, routes /api to Ruby and handles HTTPS with Let's Encrypt; zero-downtime
    deploys), database and Redis accessories, .kamal/secrets (references only) and bin/docker-entrypoint
    (migrations before the API starts). It no longer writes compose.yaml, Caddyfile or Procfile;
    existing files are left alone. See deployment.
  • gemstack doctor fails when .kamal/secrets contains a secret's value instead of a reference.
  • New apps' next.config.ts builds Next.js's standalone server for the production image.
  • Add gemstack update [VERSION]: moves the app to the latest GemStack release on rubygems.org (or
    VERSION) — sets every GemStack gem in the Gemfile to ~> VERSION and runs bundle update for them
    together; the Gemfile is restored if that fails. Apps on a GemStack checkout are told to update it.

GemStack 0.3.4

Choose a tag to compare

@github-actions github-actions released this 02 Oct 16:55
  • Models support delete_all on classes and filtered queries; it skips callbacks and validations and returns the number of rows deleted.
  • Add destroy / d for tracked models, controllers and resources, with preview, modified-file protection
    and contract refresh. Automatically remove only pending, uncommitted migrations; retain applied or
    committed history, with --remove-migrations for explicit removal of pending migrations. Reuse create
    migrations on regeneration and print migration commands for new or changed fields.

GemStack 0.3.3

Choose a tag to compare

@github-actions github-actions released this 30 Sep 10:50
  • Add the gsk executable alias, including app-local binstubs and matching help output.
  • Add reload! to the console to reload application code without restarting the console.

GemStack 0.3.2

Choose a tag to compare

@github-actions github-actions released this 30 Sep 10:13
  • gemstack shows the real error when one of its dependencies can't be loaded, instead of saying the
    gemstack gem is missing.

GemStack 0.3.1

Choose a tag to compare

@github-actions github-actions released this 30 Sep 09:09
  • New GemStack logo: a ruby gem on a stack. New apps show it on their welcome page (light and dark
    mode); the logo files are in docs/assets/logo/.
  • Docs: associations and eager loading in models: the Sequel equivalents of Rails'
    includes, eager_load and joins, and how to catch N+1 queries.