Skip to content

Test plain Rolldown builds, add hook filters, and skip Dependabot's cooldown for peer dependencies - #99

Merged
nstepien merged 10 commits into
mainfrom
plugin-audit-follow-ups
Oct 15, 2026
Merged

nstepien merged 10 commits into
mainfrom
plugin-audit-follow-ups

Conversation

@nstepien

@nstepien nstepien commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Follow-ups from auditing the plugin's workarounds against Rolldown 1.2.14 / Vite 8.3.4 after #98. Neither workaround can be dropped, so the minimum versions stay as they are:

  • Class names emitted as IIFEs: still required. With optimization.inlineConst, Rolldown 1.2.14 drops the extracted CSS for both string and template literal class names, and the upstream issues are still open.
  • Fallback when meta.magicString is missing: still required, at any version. Vite rebuilds meta to add its ssr flag, which drops Rolldown's lazily created magicString, so every Vite build and dev server takes the fallback (checked on Vite 8.2.0 and 8.3.4). Only plain Rolldown builds take the native path.

Changes

  • Test plain Rolldown builds. The suite only ran Vite builds, so the native magic string path was never exercised. A new test checks that the plugin works in a plain Rolldown build: the output code, the stylesheet modules kept in the chunk (dependency stylesheet first), no warnings, and the sourcemap position of a class name. Rolldown no longer bundles CSS (Feedback on native CSS support rolldown/rolldown#4271), so the test stands in for a CSS plugin. Without this test, coverage reports the native branch as uncovered; breaking only that branch fails this test while the 14 Vite tests still pass.
  • Hook filters.
    • transform: the manual code.includes('ecij') check moves into a code: 'ecij' filter.
    • resolveId and load: filter on the generated stylesheet ID pattern (STYLESHEET_ID_REGEX), the only IDs they answer for. load otherwise runs for every module, and in plain Rolldown builds resolveId runs for every import. For the comprehensive fixture in the Vite dev server, the handlers now run 4 + 4 times instead of 6 + 19, with identical results. The handlers become single expressions, so coverage reports no lines only a foreign ID matching the pattern could reach.
    • All filters are honored by Rolldown builds, Vite builds, and the Vite dev server on both ends of the peer range (Rolldown 1.2.0 / Vite 8.2.0 and Rolldown 1.2.14 / Vite 8.3.4).
  • Docs. Fix the stale stylesheetImportPerFile description, and correct AGENTS.md, which described the fallback as Vite-dev-only.
  • Dependabot. Dependabot now holds back new releases for 3 days by default. On 2026-10-14, it proposed rolldown 1.2.13 hours after 1.2.14 shipped the change that broke ecij, while consumers get such releases immediately within our peer ranges. rolldown and vite are now excluded from the cooldown; dev-only tooling keeps it as a supply chain safeguard. The config validates against the SchemaStore dependabot-2.0 schema. To drop the cooldown entirely later, use exclude: ['*'] (default-days cannot be 0).
  • Typos and grammar (separate commit): a misspelling, comma splices, missing words and punctuation, capitalization, and serial commas.
  • Wording. Every "e.g." is now "like", "such as", or "for example", and the README no longer joins sentences with semicolons.
  • README. List Vite, tsdown, and Rolldown from high to low level, merge the three setup snippets into one, and say "the bundler" where listing them adds nothing. tsdown runs Rolldown plugins and bundles the extracted CSS once @tsdown/css is installed (verified with tsdown 0.23.1). Like Vite, it already depends on rolldown, and npm and pnpm 10 and 12 resolve ecij's peer to that same copy.
  • Tests. assert(value, message) becomes expect(value, message).toBeTruthy(), with a short subject so failures read "JS chunk sourcemap: expected null to be truthy". The plain Rolldown test no longer passes Rolldown's default format: 'es'.

Test plan

  • node --run format:check, lint, typecheck, build
  • node --run test: 15/15 against the source and against the built dist (CI=true)
  • Mutation check: returning the original code from the native branch fails only the new test
  • Vite dev server smoke test (client and SSR) before and after the filters, on Vite 8.2.0 and 8.3.4: the same stylesheets resolve and load
  • Peer floor builds (Vite 8.2.0 + Rolldown 1.2.0, with the built plugin's own rolldown imports from 1.2.0): the same CSS and class names as current versions

🤖 Generated with Claude Code

nstepien and others added 2 commits October 15, 2026 16:07
Vite never forwards `meta.magicString` to transform hooks (it rebuilds
`meta` to add its `ssr` flag), so the Vite-based tests only exercised the
fallback that returns code with a generated sourcemap. Add a plain Rolldown
test that asserts Rolldown provides the magic string and checks the output
code, the stylesheet modules kept in the chunk and the sourcemap position.
Rolldown no longer bundles CSS, so the test stands in for a CSS plugin.
Breaking only the native branch now fails this test.

Move the 'ecij' pre-check into the transform hook's `code` filter, so
files that do not reference ecij are skipped before the handler is called.
Rolldown, Vite builds and the Vite dev server honor it across the peer range.

Also fix the stale description of `stylesheetImportPerFile`, correct the
AGENTS.md description of the fallback, and normalize Windows paths in tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dependabot holds back new releases for 3 days by default. On 2026-10-14 it
proposed rolldown 1.2.13, hours after 1.2.14 shipped the change that made
inlineConst drop ecij's extracted CSS, while consumers get such releases
immediately within ecij's peer ranges. Exempt rolldown and vite so
compatibility breaks surface in CI first; dev-only tooling keeps the delay
as a supply chain safeguard.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 664f65c3-1b2b-41ee-9f9f-998461e15eab
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

nstepien and others added 3 commits October 15, 2026 16:46
Drop the `meta.magicString` probe from the plain Rolldown test, which now
checks that the plugin works with Rolldown. Code coverage shows whether the
native magic string path is still exercised: without this test, its line
is reported as uncovered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Both hooks only answer for the stylesheet IDs generated in `transform`, so
filter them on that pattern and let Rolldown skip the handlers for every
other module. In plain Rolldown builds `resolveId` otherwise runs for every
import, and `load` runs for every module in both Rolldown and Vite builds.
The handlers become single expressions, so coverage reports no lines that
only a foreign ID matching the pattern could reach.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fix a misspelling ("outputing"), comma splices, missing verbs, articles
and punctuation, an ambiguous "both fields" after a list of three, and
"Setup" used as a verb in workflow steps and "Set up" as a heading noun.
Capitalize CSS-in-JS, CSS, and Vite consistently, use "e.g.," throughout,
and add serial commas to lists.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nstepien nstepien changed the title Cover the native magic string path, filter transforms by code, and skip Dependabot's cooldown for rolldown/vite Test plain Rolldown builds, add hook filters, and skip Dependabot's cooldown for peer dependencies Oct 15, 2026
nstepien and others added 3 commits October 15, 2026 17:36
Vitest prints the message ahead of the assertion that failed, so a short
subject reads best: "JS chunk sourcemap: expected null to be truthy".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Replace every "e.g." with "like", "such as", or "for example", and split
the semicolon-joined sentences in the README.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
tsdown runs Rolldown plugins, so ecij works with it once @tsdown/css is
installed to bundle the extracted CSS. Verified with tsdown 0.23.1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
nstepien and others added 2 commits October 15, 2026 18:11
Name the tools in that order, merge the three near-identical setup snippets
into one, and refer to "the bundler" where listing them adds nothing.
Mention tsdown alongside Vite as a project where `rolldown` is already
installed: npm and pnpm 10 and 12 resolve ecij's peer to tsdown's copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nstepien
nstepien removed this pull request from stack #101 October 15, 2026 17:11
@nstepien
nstepien added this pull request to stack #103 October 15, 2026 17:15
@nstepien
nstepien merged commit 2ec9e9b into main Oct 15, 2026
10 checks passed
@nstepien
nstepien deleted the plugin-audit-follow-ups branch October 15, 2026 17:39
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.

1 participant