Skip to content

chore(alpha): pin Jess 2.0.0-alpha.32; @plugin runs through less.render() and lessc - #4569

Merged
matthew-dean merged 8 commits into
less:alphafrom
matthew-dean:chore/pin-jess-2.0.0-alpha.32
Nov 6, 2026
Merged

matthew-dean merged 8 commits into
less:alphafrom
matthew-dean:chore/pin-jess-2.0.0-alpha.32

Conversation

@matthew-dean

Copy link
Copy Markdown
Member

Changes

  • Pins the six Jess packages at 2.0.0-alpha.32; the lockfile moves parseman to 0.61.3.
  • LessCompiler names its module, so a render that reaches a @plugin script runs whole in the @jesscss/plugin-js Deno sandbox. @plugin now works through less.render(), require('less').render() and lessc when @jesscss/plugin-js is installed.
  • Fixtures: the contrast() golden, and goldens for slash-list math, percentage() over var(), and captures in parse-interpolation, which now gates at full bytes.
  • The browser bundle's process shim gains stderr and stdout. On this Jess, every less.render() in the bundle threw on isTTY without them. test:alpha now loads the built bundle in a vm context and renders through window.less. sourceMap in the browser is not covered; it already fails with Buffer is not defined.
  • verify:alpha:packed-consumer installs @jesscss/plugin-js in its consumer and runs @plugin through less.render(), require('less').render() and lessc. Without the module identity this fails with plugin/load-failed.

Output changes from 5.0.0-alpha.17

  • Math beside a slash under the default parens-division stays as written: @a * 2 / @b + 1 gives 4px * 2 / 3px + 1, not 8px / 4px.
  • A stored slash list converts where a number is expected: percentage(16/17) gives 94.11764706%, unit(80/16, rem) gives 5rem.
  • contrast() picks the colour with the better contrast ratio: contrast(#808080) is now #000000. An explicit threshold argument keeps the old rule.
  • percentage(var(--x)) gives calc(var(--x) * 100%).

…in the Deno sandbox

less.render() built the base Jess compiler with Less's default plugins
through hooks, which cannot be rebuilt elsewhere. LessCompiler wraps that
setup in a class that declares its module identity, so a Jess release that
runs @plugin renders whole in the @jesscss/plugin-js sandbox can make the
same compiler there. With the current Jess pins nothing changes.
contrast(#ff0000) moves from #ffffff to #000000: red's ratio against black is
5.25, against white 4. `legacy/functions.css` already belongs to the
`legacy/functions.less` fixture pair, so the previous value is recorded here.
…, and capture headers

Five expected outputs move to what Jess 2.0.0-alpha.32 writes:

- A slash list held by a variable or mixin argument divides once math that
  computes reads it: `operations-advanced` (`result: 10px`) and
  `parens-division/mixins-args` (`depth: 8%`).
- Under parens-division, math beside a slash that does not divide is kept as
  written, and a parenthesized group still computes: `parens-division/parens`
  (`border-radius-keep: 4px * 2 / 4 + 3px`).
- `percentage()` over an input only the browser knows prints its CSS form:
  `math-css-vars` (`e: calc(var(--p) * 100%)`).
- `parse-interpolation`: a `selector(...)` capture prints one branch per line in
  a nested header, and the quoted `.e-quoted` case now reads `foo: baz`, which
  its source writes (the previous golden was a typo).
Moves the six Jess pins and the lockfile to 2.0.0-alpha.32, whose parser
packages pin parseman exactly at 0.61.3.

The packed consumer proof now also installs the optional @jesscss/plugin-js
peer and runs `@plugin` through `less.render()` and `lessc`. That render runs
whole in the plugin's Deno sandbox, where the compiler is made again from
`LessCompiler.moduleIdentity`, so it fails with `plugin/load-failed` if the
identity goes away. The peer is installed only in that consumer, so the fixture
suite's environment does not change.
`npm rebuild deno` exits 0 and leaves no binary on npm 12, so the @plugin check
found no Deno on Node current. Running the package's own install.cjs works on
every npm.
…ting

`.fruit-cap-` before a `&` is a class of its own, not a name prefix, and this
fixture sets collapseNesting:false, so the block stays nested under the captured
list instead of building `.fruit-cap-apple`.
`Compiler.renderToResult` reads `process.stderr.isTTY` for its colour default, so
on Jess 2.0.0-alpha.32 every `less.render()` in the browser bundle threw. A new
smoke test in `test:alpha` loads the built bundle in a `vm` context with no Node
`process` and renders through `window.less`.
…` runs `@plugin`

The fixture now matches its golden, so its expected-failure entry comes out. The
packed consumer proof also runs `@plugin` through `require('less').render()`,
which loads the bundled CommonJS build, beside the ESM and `lessc` paths.
@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: less/less.js
  • Branch: alpha
  • File: .coderabbit.yaml
  • Commit: 84170dd
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4cc72467-44e4-48f3-a93b-23df789dcc62

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

@greptile-apps

greptile-apps Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge; no actionable defect was established.

Summary

Pins Jess to 2.0.0-alpha.32 and introduces LessCompiler so sandboxed @plugin renders can recreate the compiler.

  • Less renders can run @plugin scripts through its public entry points.
  • The browser bundle can render Less without Node’s process object.
  • Slash math keeps expressions intact and records the evaluated results.
  • The default contrast() choice reflects which color contrasts better.
  • percentage() keeps CSS variables inside a valid calc() expression.
  • Interpolated selectors and captures now match the fixture’s expected CSS.

No actionable issues were established. Tests were not run; installed Jess sources were unavailable for checking the sandbox internals.

Acknowledged scope:

  • matthew-dean explicitly identifies browser sourceMap failure with Buffer is not defined as preexisting and outside this coverage.
  • matthew-dean explicitly describes the slash-math, contrast-ratio, and percentage(var()) output changes as intentional.

Reviews (1) · Last reviewed commit: "test(less): parse-interpolation gates at..." · Reviewed by Greptile

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