Skip to content

Gate compile options by Less version - #32

Merged
matthew-dean merged 2 commits into
masterfrom
feat/version-gated-options
Sep 2, 2026
Merged

matthew-dean merged 2 commits into
masterfrom
feat/version-gated-options

Conversation

@matthew-dean

Copy link
Copy Markdown
Member

What

The Options panel is now rendered from src/options.ts (supportedOptions(version)), and updateVue() sends only renderOptions(store, version) to less.render — nothing invalid or misnamed for the active version.

Option Control Versions Evidence
strictMath switch < 3.7.0 replaced by math in less.js 76c10345 (first tag v3.7.0)
math select always / parens-division / parens >= 3.7.0 same commit
strictUnits switch < 5.0.0 5.x treats it as a deprecated alias of unitMode (packages/less/lib/options.js on alpha, 7ed6ec4e)
unitMode select loose / strict / preserve >= 5.0.0 same
collapseNesting switch, off by default >= 5.0.0 5.0.0-alpha.1 7d07c112
compress switch "Minify output (deprecated)" < 5.0.0 rejected by 5.x unsupportedAlphaOptions

Prereleases compare by numeric core (5.0.0-alpha.2 → 5.0.0). Controls show/hide reactively on version change; the existing store watch re-renders. The store still holds every key, so the URL hash format is unchanged.

Verified

pnpm build green. In the dev server, wrapping less.render to log the options object:

  • 4.9.1 → Math mode, Strict units, Minify; sends { math, strictUnits, compress }
  • 3.6.0 → Strict math switch instead of Math; sends { strictMath, strictUnits, compress }; compiles
  • 5.0.0-alpha.2 (experimental) → Math mode, Unit mode, Collapse nesting; sends { math, unitMode, collapseNesting } (control visibility + option object only — that alpha's bundle 404s, so no live 5.x compile)
  • back to 4.9.1 → { math, strictUnits, compress }, no collapseNesting/unitMode

Render the Options panel from a per-version descriptor list and send only
the options valid for the active version, under that version's name:

- < 3.7.0: strictMath switch; >= 3.7.0: math select (less.js 76c10345, v3.7.0)
- < 5.0.0: strictUnits switch, deprecated compress switch;
  >= 5.0.0: unitMode select, collapseNesting switch (5.0.0-alpha options.js)

The store keeps every key (URL hash unchanged); renderOptions() filters.
@coderabbitai

coderabbitai Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 38 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: d6d79aae-778e-49f9-bea3-2d944c523d7b

📥 Commits

Reviewing files that changed from the base of the PR and between e7a529f and e8f4a84.

📒 Files selected for processing (2)
  • src/App.vue
  • src/options.ts

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.

@matthew-dean
matthew-dean merged commit 79c7640 into master Sep 2, 2026
2 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.

1 participant