fix: require marko@5.39.14 for class-runtime linkAssets support#293
Conversation
The class runtime's generated `withPageAssets` page entry only applies a configured `runtimeId` from marko@5.39.14. On older versions the server serialized component hydration data under the default `$MC` key while the client entry (compiled with the custom runtimeId) read `$<runtimeId>_C` and never hydrated (for example, `onMount` never firing). Bump the class minimum in `minRuntimeVersions` so older runtimes fall back to the legacy asset orchestration, which honors the runtimeId. Bump the marko/@marko/compiler devDependencies so the fixtures run on a version where class linkAssets is active, and add an isomorphic-link-assets-class fixture covering class API + linkAssets with a custom runtimeId.
🦋 Changeset detectedLatest commit: 5dedc5d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThe Marko v5 minimum runtime for 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/__tests__/fixtures/isomorphic-link-assets-class/server.mjs`:
- Around line 11-15: Update the createServer request listener to wrap both
handler and serve calls in try/catch; on failure, send a 500 response only when
res.headersSent is false, while preserving the existing handler-first and serve
fallback flow.
In `@src/__tests__/fixtures/isomorphic-link-assets-class/src/index.js`:
- Around line 3-9: Update the handler function so requests whose URL is not "/"
are explicitly handled: return a 404 response or delegate to the available next
middleware callback. Preserve the existing successful root-route rendering
behavior.
In `@src/__tests__/fixtures/isomorphic-link-assets-class/test.config.ts`:
- Around line 11-15: Update the steps fixture so the click action waits for and
asserts the post-hydration result, specifically that the UI displays “Clicks: 1”
after clicking `#clickable`; optionally also assert “Mounted: true”. Preserve the
existing click while ensuring the step fails when hydration does not invoke
increment.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6ed0795a-0462-4e64-a3dd-024719f45af5
⛔ Files ignored due to path filters (3)
package-lock.jsonis excluded by!**/package-lock.jsonand included by**src/__tests__/fixtures/isomorphic-link-assets-class/__snapshots__/build.expected.mdis excluded by!**/__snapshots__/**and included by**src/__tests__/fixtures/isomorphic-link-assets-class/__snapshots__/dev.expected.mdis excluded by!**/__snapshots__/**and included by**
📒 Files selected for processing (9)
.changeset/class-linkassets-min-version.mdpackage.jsonsrc/__tests__/fixtures/isomorphic-link-assets-class/dev-server.mjssrc/__tests__/fixtures/isomorphic-link-assets-class/server.mjssrc/__tests__/fixtures/isomorphic-link-assets-class/src/index.jssrc/__tests__/fixtures/isomorphic-link-assets-class/src/stateful.markosrc/__tests__/fixtures/isomorphic-link-assets-class/src/template.markosrc/__tests__/fixtures/isomorphic-link-assets-class/test.config.tssrc/link-assets.ts
Description
Bumps the class-runtime minimum in
minRuntimeVersions(link-assets.ts) tomarko@5.39.14, below which the plugin now falls back to the legacy asset orchestration instead of the compiler'slinkAssetspath. Also bumps themarko/@marko/compilerdevDependencies so the suite runs on a version where classlinkAssetsis active, and adds anisomorphic-link-assets-classfixture (class API +linkAssets+ a customruntimeId).Motivation and Context
The class runtime's generated
withPageAssetspage entry only applies a configuredruntimeIdfrommarko@5.39.14. On older versions the server serialized component hydration data under the default$MCkey while the client entry (compiled with the customruntimeId) read$<runtimeId>_Cand found nothing, so SSR components never hydrated (for example,onMountnever firing). No class fixture previously exercisedlinkAssets, leaving this path untested.Checklist:
Generated by Claude Code