Skip to content

Switch host build to vite#4019

Merged
lukemelia merged 45 commits intomainfrom
vite
May 4, 2026
Merged

Switch host build to vite#4019
lukemelia merged 45 commits intomainfrom
vite

Conversation

@ef4
Copy link
Copy Markdown
Contributor

@ef4 ef4 commented Feb 18, 2026

Migrates the @cardstack/host build/serve/test pipeline from the
classic Ember-CLI / webpack pipeline to Vite via @embroider/vite,
with the supporting runtime/test infrastructure updated to work in a
pure-ESM host build.

Reviewer's guide

This is a long-running branch (months of iteration), now squashed and
re-ordered into 41 commits for review. The work groups into eight
themes — start with the foundational ones and skim the rest:

# Theme Where to look Notes
1 Host build pipeline (Vite + Embroider Vite) packages/host/vite.config.mjs, packages/host/babel.config.cjs, packages/host/ember-cli-build.js, packages/host/index.html, packages/host/scripts/serve-dist.js, packages/host/package.json, packages/host/lib/{empty-fs,build/*} Switches ember build/serve to vite build/vite preview. Production minifier evolved through several iterations (rolldown oxc → esbuild w/ keepNames in production-only mode); see commit host: production minifier + dynamic-import URL handling for the consolidated story.
2 runtime-common browser/ESM split packages/runtime-common/{fetch-node,fetch-browser,scoped-css,transpile,etc}.ts, package imports (#fetch, #lint-task, #transpile) Drops jsonwebtoken from the browser bundle (constructor-name checks for JWT errors), inlines a local isScopedCSSRequest so postcss/source-map-js stays out of browser builds, and conditionally maps node-only modules (undici, etc.) so they don't get pulled into the browser graph.
3 Drop AMD registry + content-tag global packages/realm-server/tests/helpers/prerender-page-patches.ts, packages/host/app/services/monaco-service.ts, packages/host/app/modifiers/monaco.ts, packages/realm-server/main.ts, packages/runtime-common/transpile.ts, packages/host/lib/empty-fs.js, packages/workspace-sync-cli/scripts/build.ts The biggest semantic change: prerender patches use ApplicationInstance.factoryFor(...) instead of looking up via the legacy AMD require registry. Content-tag is imported directly (no more globalThis.ContentTagGlobal). Monaco workers via Vite ?worker entrypoints.
4 Dependency patches patches/postcss@8.5.6.patch, patches/object-inspect.patch, patches/matrix-js-sdk@38.3.0.patch, package.json patchedDependencies Workarounds for vite/rolldown compatibility. The original postcss patch is later replaced by a rolldown resolver plugin (commit Replace postcss patch with rolldown resolver plugin).
5 Test infra: boot + harness packages/host/tests/{index.html,test-helper.js,live-test.js}, packages/host/testem.js, packages/software-factory/src/harness/support-services.ts, packages/software-factory/src/test-run-execution.ts, packages/software-factory/playwright.config.ts Tests boot via Vite-driven ESM module discovery + ember-exam. SF harness serves the host dist via vite preview; adds a globalThis.global shim for QUnit page generation. Playwright workers serialized to 1 to keep CI memory in budget after vite host bundling.
6 Vite-specific test stabilizations + lints scattered under packages/host/tests/**, packages/host/.eslintrc.js, packages/local-types/index.d.ts, ember 6.10 deprecation handlers Smaller individual fixes — race conditions, type updates, prettier compliance, federated-search test update, NewField primitive init.
7 Memory baseline packages/host/memory-baseline.json Vite has different runtime memory characteristics; baselines are higher than main's. Important: the baseline conflict on this file recurs every time main lands a baseline-update commit — see the open question below.
8 Review fixes last commit Addresses Copilot review nits (typo + dedup of three stylesheet imports).

Where to start

If you have 30 minutes:

  1. packages/host/vite.config.mjs — the new build config
  2. packages/host/babel.config.cjs + packages/host/ember-cli-build.js — what's left of the old pipeline
  3. packages/runtime-common/package.json imports — the conditional-export wiring that lets the same source compile for node and browser
  4. packages/realm-server/tests/helpers/prerender-page-patches.ts — the non-AMD module-lookup pattern that everyone touching prerender tests will need to follow

Outstanding / known issues

Test plan

History

This branch was rebased + squashed from ~97 entries (75 non-merge + 22 merges) down to 41 logical commits, with the cleanly-revertible CI-disable scaffolding triple dropped. Authors of squashed commits are preserved in the surviving commit metadata. Original branch tip prior to cleanup: 9dd2f4b62e.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 18, 2026

Host Test Results

    1 files      1 suites   2h 39m 6s ⏱️
2 474 tests 2 459 ✅ 15 💤 0 ❌
2 493 runs  2 478 ✅ 15 💤 0 ❌

Results for commit b7c3afd.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 19, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

Realm Server Test Results

    1 files      1 suites   18m 35s ⏱️
1 102 tests 1 102 ✅ 0 💤 0 ❌
1 174 runs  1 174 ✅ 0 💤 0 ❌

Results for commit b7c3afd.

♻️ This comment has been updated with latest results.

@ef4
Copy link
Copy Markdown
Contributor Author

ef4 commented Apr 3, 2026

@lukemelia status on this is:

  • the app boots in dev.
  • In tests, the next step is getting the ember-exam test loader working.

@ef4
Copy link
Copy Markdown
Contributor Author

ef4 commented Apr 10, 2026

Leading edge of work:

@ef4
Copy link
Copy Markdown
Contributor Author

ef4 commented Apr 16, 2026

The leading edge of this work that I'm investigating is why postcss is now broken in our builds.

I have created a minimal reproduction that's ready to be debugged further. The presence of the embroider resolver inside rolldown breaks the behavior of how postcss sees its stubbed-for-the-browser dependencies. If you take that one line out of the vite config, postcss works.

@ef4
Copy link
Copy Markdown
Contributor Author

ef4 commented Apr 16, 2026

lukemelia added a commit that referenced this pull request Apr 20, 2026
Only ci-host.yaml's 20-shard host suite should run on PR #4019 while
the vite migration is in progress. Revert before merging to main.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
lukemelia added a commit that referenced this pull request Apr 20, 2026
Same rationale as ci.yaml — only ci-host.yaml should run on PR #4019
during the vite migration. Revert before merging to main.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ef4 ef4 marked this pull request as ready for review April 30, 2026 17:46
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

Preview deployments

Host Test Results

    1 files  ±    0      1 suites  ±0   3h 59m 9s ⏱️ + 2h 0m 27s
2 562 tests ±    0  2 536 ✅  -    11  15 💤 ± 0   0 ❌ ± 0  11 🔥 +11 
5 162 runs  +2 581  5 110 ✅ +2 544  30 💤 +15  11 ❌ +11  11 🔥 +11 

Results for commit 1a8d1ca. ± Comparison against earlier commit b4d737e.

Realm Server Test Results

    1 files  ±0      1 suites  ±0   18m 4s ⏱️ -26s
1 212 tests ±0  1 212 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 284 runs  ±0  1 284 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 1a8d1ca. ± Comparison against earlier commit b4d737e.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the @cardstack/host build/serve/test pipeline from the classic Ember/Webpack-based setup to Vite (via @embroider/vite), and updates supporting runtime/test infrastructure across the monorepo to work in a pure-ESM host build.

Changes:

  • Switch host build and preview from ember build/serve to vite build/vite preview with a new packages/host/vite.config.mjs.
  • Update runtime-common and host codepaths to be browser/ESM-friendly (conditional imports, logging init order, scoped CSS helpers, content-tag usage, etc.).
  • Adjust realm-server, software-factory, and host tests to no longer rely on AMD registries and to reduce CI flakiness/resource usage.

Reviewed changes

Copilot reviewed 66 out of 69 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pnpm-workspace.yaml Removes catalog entries for webpack-specific/legacy build deps no longer needed after Vite migration.
pnpm-lock.yaml Lockfile updates reflecting Vite/Embroider/Vitest dependency graph changes and new patches.
patches/object-inspect.patch Patch to fix object-inspect internal require resolution by adding .js extension.
patches/matrix-js-sdk@38.3.0.patch Extends patched SDK filter JSON output to include an MSC field with a default.
packages/workspace-sync-cli/scripts/build.ts Copies content-tag WASM artifact into CLI dist to satisfy runtime __dirname resolution.
packages/software-factory/tests/factory-tool-executor.spec.ts Adds clarifying test comments about federated search auth token expectations.
packages/software-factory/src/test-run-execution.ts Adds globalThis.global shim to prevent Vite-bundled host tests from failing in QUnit page generation.
packages/software-factory/src/harness/support-services.ts Switches host serving in harness from serve to vite preview.
packages/software-factory/playwright.config.ts Serializes Playwright workers to reduce CI memory pressure after Vite host bundling.
packages/runtime-common/worker.ts Lazy-loads Node stream conversion to avoid bundling stream into browser builds.
packages/runtime-common/virtual-network.ts Replaces in-file env-aware fetch with conditional #fetch import mapping.
packages/runtime-common/transpile.ts Switches template compiler import strategy; adds deterministic template IDs and updates content-tag usage/filename handling.
packages/runtime-common/tasks/lint-browser.ts Adds a browser stub for the lint task via package import conditions.
packages/runtime-common/tasks/index.ts Re-exports lint task via conditional #lint-task and exports lint types separately.
packages/runtime-common/scoped-css.ts Re-implements scoped CSS request helpers locally to avoid pulling CJS postcss/source-map-js into browser bundles.
packages/runtime-common/realm.ts Normalizes debug filenames for Babel/template compilation; removes jsonwebtoken dependency and switches to constructor-name checks for JWT errors.
packages/runtime-common/realm-index-query-engine.ts Uses local scoped-css helper instead of glimmer-scoped-css direct import.
packages/runtime-common/package.json Adds imports mappings for #fetch and #lint-task; removes jsonwebtoken typings/deps.
packages/runtime-common/module-syntax.ts Updates content-tag usage to import directly (no longer via global).
packages/runtime-common/log.ts Makes logger tolerant of late-installed log definitions; adds reapplyLogLevels() for bundler chunk init ordering.
packages/runtime-common/loader.ts Adjusts AMD define capture so bundlers don’t incorrectly optimize away eval-visible locals.
packages/runtime-common/index.ts Re-exports reapplyLogLevels from runtime-common public API.
packages/runtime-common/index-query-engine.ts Uses local scoped-css helper instead of glimmer-scoped-css direct import.
packages/runtime-common/fetch-node.ts New node-only env-aware fetch with Undici Agent + localhost-subdomain DNS override.
packages/runtime-common/fetch-browser.ts New browser-only env-aware fetch passthrough.
packages/runtime-common/etc.ts Removes old compiler shim module (replaced by new compiler import path in transpile).
packages/realm-server/tests/prerendering-test.ts Updates prerender test injection to locate Ember classes via ApplicationInstance instead of AMD registry.
packages/realm-server/tests/index.ts Removes global ContentTagGlobal injection from realm-server test bootstrap.
packages/realm-server/tests/helpers/prerender-page-patches.ts Updates patching strategy to use ApplicationInstance factoryFor rather than AMD module lookup.
packages/realm-server/tests/card-source-endpoints-test.ts Updates assertions to match new moduleName behavior (no absolute worktree paths).
packages/realm-server/server.ts Simplifies assets URL rewriting now that content-tag standalone asset path is removed.
packages/realm-server/main.ts Removes global ContentTagGlobal injection from realm-server main entrypoint.
packages/local-types/index.d.ts Removes global ContentTagGlobal typing and reformats some Glint helper/modifier typings.
packages/host/vite.config.mjs New Vite config for Ember host build (Embroider Vite, rollup/rolldown settings, optimizeDeps workarounds, preview headers/CORS, keepNames).
packages/host/types/index.d.ts Adds Vite and Embroider virtual types references.
packages/host/tsconfig.json Adds Embroider virtual types to TS types list.
packages/host/tests/unit/ai-function-generation-test.ts Adjusts static field declaration to be valid under the new build/type pipeline.
packages/host/tests/test-helper.js Refactors test boot to support ESM and Vite-driven module discovery; improves error logging for live tests.
packages/host/tests/serve.json Removes legacy serve headers config (now handled by Vite preview config).
packages/host/tests/live-test.js Stops monkey-patching frozen QUnit namespace; tracks registered modules by diffing QUnit’s module list.
packages/host/tests/integration/realm-test.gts Normalizes compiled template IDs in assertions to avoid non-deterministic values.
packages/host/tests/index.html Reworks test index to use Embroider virtual assets and ESM-based test startup with Vite module globbing.
packages/host/testem.js Guards Node-only module.exports usage for ESM environments.
packages/host/scripts/serve-dist.js Switches dist serving from serve to vite preview and documents preview configuration behavior.
packages/host/public/standalone.js Removes old content-tag standalone asset entry.
packages/host/package.json Updates scripts and devDependencies for Vite/Embroider Vite; removes webpack-only deps; adds Vite build/test helper script.
packages/host/memory-baseline.json Updates memory baseline numbers consistent with new bundling/runtime characteristics.
packages/host/lib/empty-fs.js Adds browser stub module for Node fs used by certain dependencies under Rolldown/Vite.
packages/host/lib/build/package-dist-checksums.js Removes old Webpack plugin for boxel-ui checksum emission (webpack build pipeline removed).
packages/host/index.html New Vite/Embroider host HTML entrypoint with assetsURL bootstrap and global shims.
packages/host/ember-cli-build.js Updates compat build to use @embroider/vite buildOnce instead of @embroider/webpack; removes webpack-specific packager config.
packages/host/config/targets.js Removes node target entry (browser target list only).
packages/host/babel.config.cjs New Babel config for Vite pipeline (TS transform, template compilation, decorators, runtime helpers, Embroider compat).
packages/host/app/services/monaco-service.ts Switches Monaco worker loading to Vite ?worker entrypoints and installs MonacoEnvironment worker mapping; preserves global monaco for tests.
packages/host/app/resources/live-prerendered-search.ts Imports scoped CSS request helpers from runtime-common rather than glimmer-scoped-css directly.
packages/host/app/modifiers/monaco.ts Removes requirejs-monaco polyfill import (AMD no longer present).
packages/host/app/lib/setup-globals.ts Calls reapplyLogLevels() after installing log definitions to handle bundler evaluation order.
packages/host/app/lib/public-path.ts Removes webpack public path logic; keeps boot timing marker.
packages/host/app/lib/glint-embroider-workaround.js Removes now-obsolete glint/embroider AMD workaround.
packages/host/app/index.html Removes old ember-cli-generated HTML entry.
packages/host/app/config/environment.ts Switches to @embroider/config-meta-loader + runtime asserts for config shape; exports typed config.
packages/host/app/commands/sanitize-module-list.ts Imports scoped CSS helper from runtime-common rather than glimmer-scoped-css directly.
packages/host/app/app.ts Uses Embroider virtual compat modules for Resolver/initializers; updates config import path for ESM build.
packages/host/.gitignore Adds /tmp/ to ignored paths.
packages/host/.eslintrc.js Adds babel.config.cjs to node-file override list.
packages/boxel-ui/addon/src/components/select/index.gts (Currently) adds a duplicate stylesheet side-effect import.
packages/boxel-ui/addon/src/components/multi-select/index.gts (Currently) adds a duplicate stylesheet side-effect import.
packages/boxel-ui/addon/src/components/date-range-picker/index.gts (Currently) adds a duplicate stylesheet side-effect import.
package.json Registers the new object-inspect patch in pnpm patchedDependencies.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/host/index.html Outdated
Comment thread packages/boxel-ui/addon/src/components/select/index.gts Outdated
Comment thread packages/boxel-ui/addon/src/components/multi-select/index.gts Outdated
Comment thread packages/boxel-ui/addon/src/components/date-range-picker/index.gts Outdated
lukemelia added a commit that referenced this pull request May 3, 2026
- Fix typo "insn't" → "isn't" in host index.html comment
- Dedupe `ember-power-select/styles` side-effect import in select +
  multi-select components
- Dedupe `ember-power-calendar/styles` side-effect import in
  date-range-picker

The duplicates were introduced by an ESLint auto-fix in 5b4af70
that moved the import to the top of each file but failed to remove
the original copy at the same time.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ef4 added 15 commits May 3, 2026 17:20
First foundation commit for the vite migration. Adds vite.config.mjs
and babel.config.cjs, moves the host index.html from app/index.html
to a top-level Vite entrypoint, drops the glint/embroider AMD
workaround and the content-tag standalone bundle, replaces
environment.d.ts typing with a runtime environment.ts loader, and
adjusts app.ts / public-path.ts / monaco.ts / .eslintrc.js /
.gitignore / config/targets.js / package.json for the new pipeline.
Adds patches/postcss@8.5.6.patch for vite/rolldown compatibility and
registers it in package.json. Vite no longer hoists addon stylesheets,
so explicit `import 'ember-power-select/styles'` /
`import 'ember-power-calendar/styles'` lines are added in the three
boxel-ui components that consume those addons. Minor tweaks in
host/index.html and app.ts for the patched setup.
Refactors tests/test-helper.js and tests/index.html for ESM/Vite test
boot, updates testem.js for ESM environments, adds the runtime-common
browser stub for the lint task, and tweaks vite.config.mjs.
Under vite, we don't use an AMD loader so we won't conflict with the one in monaco.
…ion workflow

Removes the legacy compiler shim at runtime-common/etc.ts (replaced by
the new content-tag / transpile path). Adjusts transpile.ts and host
deprecation-workflow.js, plus host package.json + lockfile churn from
the dependency cleanup.
Simplifies buildEtag() in realm.ts so the ETag is just the base /
lastModified value (no `v2:` prefix). Toolchain bumps now flow through
content hashing and don't need a hand-rolled cache-bust prefix.
Reapplies vite's index.html asset URL structure after a main-merge
stomped on it.
Removes lib/build/package-dist-checksums.js (the webpack plugin for
boxel-ui checksum emission), simplifies app/lib/public-path.ts (no
more webpack public-path logic), and clears webpack-only blocks from
ember-cli-build.js. Folds in glint typing cleanup in
local-types/index.d.ts and the boxel-icons unpublished-development-
types declaration.
lukemelia and others added 16 commits May 3, 2026 17:20
Node's ESM resolver (called from dynamic import() at runtime) does not
do TypeScript extension resolution, so `await import('./transpile')`
throws ERR_MODULE_NOT_FOUND on the realm server. Static imports were
fine because ts-node transforms them at compile time, but the dynamic
import I added in 6694960 bypasses that path.

Use `./transpile.ts` explicitly — matches the existing convention in
realm-server/tests/module-syntax-test.ts and is compatible with
allowImportingTsExtensions in tsconfig. Vite's dev server and Rolldown
both handle .ts extensions in dynamic imports.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The vite branch's 9cd7b02 deleted packages/host/tests/serve.json and
switched serve:dist to `vite preview --port 4200`. A later main→vite
merge brought in Buck's Traefik wrapper (86301ac), which reintroduced
a `serve --config ../tests/serve.json` invocation inside
scripts/serve-dist.js. CI's start:host-dist has been failing with ENOENT
on the deleted serve.json ever since.

Rewrite the Traefik-aware wrapper to spawn `vite preview` instead, and
move the CORS + Cache-Control: no-store headers that serve.json provided
into vite.config.mjs under `preview`.
…tled

Every other skill-menu click in commands-test.gts waits for
[data-room-settled] after opening the assistant. This one didn't, so
the skill menu pill wasn't rendered when the click fired. The ember-cli
build happened to settle in time; vite's timing surfaces the race.
…nsform

esbuild:keepNames routes .ts files through esbuild before rollup's babel
plugin, and esbuild converts class fields (x = foo()) into constructor
__publicField(this, "x", foo()) calls. That breaks ember-concurrency's
async-arrow-task-transform, which only matches ClassProperty nodes -- the
CallExpression ends up parented by AssignmentExpression after esbuild.

Name preservation is still handled by rolldownOptions.output.keepNames
through Vite 8's oxc-minifier. Letting babel do all TypeScript handling
keeps class fields intact through the async-arrow transform.

Verified: rebuilt host dist now emits
  loginTask = b(() => ({ context: this, generator: f... }))
instead of the untransformed
  loginTask = i(async () => { ... })
Under ember-cli-babel, an uninitialized class field like
    static [primitive]: number;
would be emitted as an empty class field (equivalent to
`static [primitive] = undefined`), so `primitive in NewField` was true
at runtime. The ai-function-generation "skips over fields that can't be
recognised" test relied on that: it needs the primitive symbol to be a
runtime property so the skip path in generateJsonSchemaForContainsFields
kicks in.

Under the vite build's babel config (onlyRemoveTypeImports + decorator
transforms), the uninitialized field is stripped from the emitted class,
so `primitive in NewField` is false, the non-primitive branch runs, and
an extra `skipField: { type: "object", properties: {} }` leaks into the
schema.

Use an explicit `undefined` initializer so the class property exists at
runtime regardless of which babel pipeline compiled it.
Previously testem stringified the thrown object as `[object Object]`,
hiding the underlying error. Concatenate stack/message into the log
line so the actual failure is visible in CI output.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
tests/serve.json was removed when host moved to vite, but the
software-factory harness still spawned `npx serve --config tests/serve.json`
and crashed with ENOENT in CI. Invoke `vite preview` (the same tool
scripts/serve-dist.js uses) on a chosen free port instead.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
ember-source's defaultId hashes template source via node's crypto
module, reached through `module.require` or `globalThis.require`. The
vite branch switched transpile.ts to import the ESM source entry
(`ember-source/ember-template-compiler/index.js`) where neither handle
exists, so defaultId falls back to `() => null`. The emitted template
JSON then contains the literal `"id": null` (unquoted), which breaks
realm-server card-source-endpoints-test.ts assertion 8 — the test's
`/"id":\s"[^"]+"/` normalization regex only matches quoted id strings.

Wrap compiler.precompile so we always pass an `id` option backed by
super-fast-md5. md5 is already a runtime-common dep, works identically
in node and the browser, and produces a stable 8-char token that the
test regex replaces with `"<id>"` before comparing against the
compiled-card fixture.
…nder patches

The vite host build has no window.requirejs.entries / _eak_seen module
registry to walk, so the page-side lookups silently failed: the render
route patch threw "render route module not found for injection" and the
RealmServerService bypass patch returned early, leaving
assertOwnRealmServer intact so cross-origin query-fallback searches never
dispatched `_federated-search` and RuntimeRealm.search was never invoked.

Reach the classes through the Ember ApplicationInstance that the
export-application-global instance-initializer exposes on
window['@cardstack/host'] and call factoryFor('service:realm-server') /
factoryFor('route:render') instead.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Squashed bucket of minifier-related work:
- Rolldown's oxc minifier for production builds
- esbuild minifier (production-mode only) with keepNames so
  ember-concurrency's async-arrow transform survives
- Resolve dynamic-import chunks against the configured distURL
- Fall back to "/" when __boxelAssetsURL is unset
- Move the static <title> between the head-injection markers so
  prerendered HTML overrides it cleanly
The patch's `toJSON` change in src/filter-component.ts only takes effect
when the host imports matrix-js-sdk via its source. ember-cli-build.js
aliased `matrix-js-sdk` to `matrix-js-sdk/src/browser-index.ts`, so the
webpack/embroider build picked up the patched source. Vite resolves via
`package.json` main/browser, which point at the unpatched lib/ output —
so `org.matrix.msc3874.not_rel_types: ['m.replace']` was silently dropped
from the timeline filter and synapse returned replace events on /messages.

Mirror the source-level patch in lib/filter-component.js so the runtime
emits the custom filter regardless of which entry point the bundler picks.
Fixes the matrix-client "filters out messages with m.replace when loading
room history" test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Squashed bucket of SF harness adjustments under vite. The real
behavior changes that survive the temp debug round-trip:
- shim globalThis.global so vite-bundled host tests don't fail in
  QUnit page generation
- serialize Playwright workers (workers=1) to reduce CI memory
  pressure after vite host bundling
- clarifying test comments on federated-search auth-token expectations
The vite build produces broadly different per-module heap deltas than
Embroider/webpack — most modules drift +5–35 MB. Bake those in so the
gate gives focused signal on the modules that look like real
regressions, not noise.

Three modules retain their pre-vite baselines so the gate keeps
flagging them for investigation:
- Acceptance | host submode (-11.9 → 93 MB)
- Acceptance | interact submode creation & permissions (10.9 → 83.3 MB)
- Integration | card-delete (-8.9 → 64 MB)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Fix typo "insn't" → "isn't" in host index.html comment
- Dedupe `ember-power-select/styles` side-effect import in select +
  multi-select components
- Dedupe `ember-power-calendar/styles` side-effect import in
  date-range-picker

The duplicates were introduced by an ESLint auto-fix in 5b4af70
that moved the import to the top of each file but failed to remove
the original copy at the same time.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The hybrid rebase used `-X theirs` to auto-bias conflict resolution
toward each replayed vite commit. That worked for the bulk of conflicts,
but in some files main introduced changes after the original vite-side
edit that the original merges had absorbed (e.g. `rri` import,
content-hash ETag, PowerSelectMultiple import). `-X theirs` discarded
those, so this commit folds them back in to make the cleaned-up branch
tree-equal to the previous vite tip.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment on lines -16 to -20
trees: {
app: withSideWatch('app', {
watching: ['../runtime-common', '../boxel-ui/addon'],
}),
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so do we still get this behavior where if runtime-common or boxel-ui updates the host app will automatically rebuild? or are we back to the old days where we'd have to restart ember cli to pick up these changes?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this out and found that boxel-ui changes do cause a rebuild if pnpm start is running in packages/boxel-ui/addon, which is the same as before.

In the current main, I found that changing packages/runtime-common/realm.ts caused host to rebuild but it didn’t look to me that the actual change was being included in the application, as neither the constructor logging I added nor a change that should have made all realms appear to be indexing were in evidence:

CleanShot 2026-05-04 at 08 14 43

While I would prefer changes to runtime-common to be picked up without having to restart, I don’t think it’s a regression. But I do have a weird local environment so it could be that I’m missing expected behaviour locally.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

@habdelra habdelra May 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@backspace I thought we only created and used Realms in the host app in tests--for browser based realms, not the live application. perhaps your log was in the wrong place

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@backspace I thought we only created and used Realms in the host app in tests--for browser based realms, not the live application. perhaps your log was in the wrong place

you’re correct, thanks, I put logging in virtual-network instead and it did show, so I canceled 11017

@backspace
Copy link
Copy Markdown
Contributor

I’m trying this out locally, I noticed that the mise start dev-all doesn’t work because the output it’s waiting for from the old build pipeline never arrives.

Environment mode also doesn’t work but I can fix that independently.

Some of the Percy diffs are pretty strange:

CleanShot 2026-05-04 at 07 17 23@2x

I’ll follow up once I have the stack running locally.

@backspace backspace mentioned this pull request May 4, 2026
@backspace
Copy link
Copy Markdown
Contributor

The existing Ember CLI build has a tremendous amount of noise and this seems to have significantly less, but is it possible to address these warnings to make it even quieter?

Sourcemap for "/Users/b/Documents/Cardstack/Code/boxel-motion-worktrees/vite/packages/host/node_modules/.vite/deps/lib-BsFnQJ11.js" points to a source file outside its package: "/Users/b/Documents/Cardstack/Code/boxel-motion-worktrees/vite/node_modules/.pnpm/@babel+generator@7.28.6/node_modules/@babel/generator/lib/generators/classes.js"
Sourcemap for "/Users/b/Documents/Cardstack/Code/boxel-motion-worktrees/vite/packages/host/node_modules/.vite/deps/lib-BsFnQJ11.js" points to a source file outside its package: "/Users/b/Documents/Cardstack/Code/boxel-motion-worktrees/vite/node_modules/.pnpm/@babel+generator@7.28.6/node_modules/@babel/generator/lib/generators/methods.js"
Sourcemap for "/Users/b/Documents/Cardstack/Code/boxel-motion-worktrees/vite/packages/host/node_modules/.vite/deps/lib-BsFnQJ11.js" points to a source file outside its package: "/Users/b/Documents/Cardstack/Code/boxel-motion-worktrees/vite/node_modules/.pnpm/@babel+generator@7.28.6/node_modules/@babel/generator/lib/generators/modules.js"
Sourcemap for "/Users/b/Documents/Cardstack/Code/boxel-motion-worktrees/vite/packages/host/node_modules/.vite/deps/lib-BsFnQJ11.js" points to a source file outside its package: "/Users/b/Documents/Cardstack/Code/boxel-motion-worktrees/vite/node_modules/.pnpm/jsesc@3.1.0/node_modules/jsesc/jsesc.js"
Sourcemap for "/Users/b/Documents/Cardstack/Code/boxel-motion-worktrees/vite/packages/host/node_modules/.vite/deps/lib-BsFnQJ11.js" points to a source file outside its package: "/Users/b/Documents/Cardstack/Code/boxel-motion-worktrees/vite/node_modules/.pnpm/@babel+generator@7.28.6/node_modules/@babel/generator/lib/generators/types.js"
Sourcemap for "/Users/b/Documents/Cardstack/Code/boxel-motion-worktrees/vite/packages/host/node_modules/.vite/deps/lib-BsFnQJ11.js" points to a source file outside its package: "/Users/b/Documents/Cardstack/Code/boxel-motion-worktrees/vite/node_modules/.pnpm/@babel+generator@7.28.6/node_modules/@babel/generator/lib/generators/flow.js"
Sourcemap for "/Users/b/Documents/Cardstack/Code/boxel-motion-worktrees/vite/packages/host/node_modules/.vite/deps/lib-BsFnQJ11.js" points to a source file outside its package: "/Users/b/Documents/Cardstack/Code/boxel-motion-worktrees/vite/node_modules/.pnpm/@babel+generator@7.28.6/node_modules/@babel/generator/lib/generators/base.js"

Copy link
Copy Markdown
Contributor

@backspace backspace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exciting!

I think this can be merged and the small problems can be addressed separately.

// from the browser does not drag in `glimmer-scoped-css`'s CJS entry (which
// transitively requires `postcss` → `source-map-js`). The glimmer-scoped-css
// package emits URLs ending in `.glimmer-scoped.css` with the encoded CSS
// baked into the filename; decoding is just a base64-ish round-trip.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we control this dependency, should we have an issue for upstreaming this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// observed as "hosted runner lost communication with the server" at
// ~53min. Serializing keeps total runtime at ~33min and is reliable.
// TODO: revisit after the vite migration stabilises (e.g. tag the
// heavy specs and run them in a dedicated worker pool).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an issue for this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* When BOXEL_ENVIRONMENT is not set, behaves identically to the old serve:dist command.
* When BOXEL_ENVIRONMENT is not set, previews on port 4200.
*
* CORS headers and SPA fallback are configured in vite.config.mjs under `preview`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn’t see this so maybe #4636 is unnecessary? I’ll return to this to confirm.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated #4636 with another commit that extracts shared setup for Traefik/environment mode and Vite

module.exports = {
calculateBoxelUIChecksum,
BoxelUIChecksumPlugin,
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a nice feature, is it recoverable? I confirmed that if I change something in boxel-ui without its build running, host doesn’t notice

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lukemelia and others added 4 commits May 4, 2026 12:09
The vite branch's `start` script was just `vite`, which let vite pick
its default port (5173). The `mise start dev-all` task starts the host
in the background and polls `HOST_URL` (http://localhost:4200) for HTTP
200, so the readiness check timed out at 120s and the rest of the dev
stack never came up.

Replace `scripts/ember-serve.js` with `scripts/vite-serve.js` (same
shape: standard mode binds to 4200; BOXEL_ENVIRONMENT mode picks a free
port, sets MATRIX_URL, and registers with Traefik). Update `start` to
`pnpm ensure-boxel-ui && node scripts/vite-serve.js`, restoring the
boxel-ui conditional rebuild that the previous `start` performed and
which a fresh checkout depends on.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts:
#	packages/host/memory-baseline.json
@lukemelia lukemelia merged commit 1b8d312 into main May 4, 2026
104 of 107 checks passed
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.

5 participants