Skip to content

fix: remove ValidScopedCSSClass from recommended config (temp)#1180

Merged
aswamy merged 1 commit into
mainfrom
fix/disable-valid-scoped-css-class-recommended
Apr 17, 2026
Merged

fix: remove ValidScopedCSSClass from recommended config (temp)#1180
aswamy merged 1 commit into
mainfrom
fix/disable-valid-scoped-css-class-recommended

Conversation

@aswamy
Copy link
Copy Markdown
Contributor

@aswamy aswamy commented Apr 17, 2026

Summary

  • Set recommended: false on the ValidScopedCSSClass check
  • Regenerated packages/theme-check-node/configs/recommended.yml (factory-generated file)
  • Added a patch changeset

⚠️ Temporary fix

This is a temporary fix while we resolve performance issues for this theme-check on VS Code. The check was introduced in v3.11.2 and causes severe save lag on larger themes — users report VS Code hanging for several seconds on every save with a "Getting code actions from 'Shopify Liquid'" message (see #1179).

Root cause: every save re-parses every `{% stylesheet %}` tag in the theme to build the in-scope CSS class set. On a 240-file theme that's ~128 liquid-HTML + postcss parses per save.

A performance fix (session-level caching of per-file CSS classes + substring short-circuit before AST parse) is in progress and will be landed as a separate PR. Once that ships and is validated on large themes, we'll flip this check back to `recommended: true`.

Impact

  • Users upgrading to the next patch release will no longer see `ValidScopedCSSClass` warnings by default.
  • The check still works and is available via `extends: theme-check:all` or by opting in explicitly in `.theme-check.yml`.
  • No API changes.

Test plan

  • `yarn build` completes successfully (generated configs updated)
  • `ValidScopedCSSClass` no longer appears in `packages/theme-check-node/configs/recommended.yml`
  • `ValidScopedCSSClass` still appears in `packages/theme-check-node/configs/all.yml`
  • Existing tests for the check still pass (`yarn test`)

🤖 Generated with Claude Code

Temporary fix while performance issues are resolved.

The check re-parses every {% stylesheet %} tag in the theme on every
save, causing severe lag in VS Code on larger themes (reported in
#1179 — "Getting code actions from Shopify Liquid" hangs for several
seconds on save in v3.11.2).

The check remains available as an opt-in rule in the :all preset. It
will be re-added to :recommended once the language-server performance
work in progress (PR forthcoming) lands.
@aswamy aswamy requested a review from a team as a code owner April 17, 2026 19:07
@aswamy aswamy merged commit 5f098a2 into main Apr 17, 2026
8 checks passed
@aswamy aswamy deleted the fix/disable-valid-scoped-css-class-recommended branch April 17, 2026 19:19
aswamy added a commit that referenced this pull request Apr 20, 2026
Moves per-file CSS class extraction onto the language server's
AugmentedLiquidSourceCode so it is memoized per file version and
invalidated automatically when a document changes. Eliminates the
full-theme rescan that ran on every save. Also skips syntax-tree
parsing for Liquid files with no stylesheet tag, cutting first-save
and CLI-run costs.

Re-enables ValidScopedCSSClass in the recommended config, reversing
the temporary opt-out from #1180.

Fixes #1179.
aswamy added a commit that referenced this pull request Apr 20, 2026
Moves per-file CSS class extraction onto the language server's
AugmentedLiquidSourceCode so it is memoized per file version and
invalidated automatically when a document changes. Eliminates the
full-theme rescan that ran on every save. Also skips syntax-tree
parsing for Liquid files with no stylesheet tag, cutting first-save
and CLI-run costs.

Re-enables ValidScopedCSSClass in the recommended config, reversing
the temporary opt-out from #1180.

Fixes #1179.
aswamy added a commit that referenced this pull request Apr 20, 2026
Moves per-file CSS class extraction onto the language server's
AugmentedLiquidSourceCode so it is memoized per file version and
invalidated automatically when a document changes. Eliminates the
full-theme rescan that ran on every save. Also skips syntax-tree
parsing for Liquid files with no stylesheet tag, cutting first-save
and CLI-run costs.

Re-enables ValidScopedCSSClass in the recommended config, reversing
the temporary opt-out from #1180.

Fixes #1179.
aswamy added a commit that referenced this pull request Apr 22, 2026
Moves per-file CSS class extraction onto the language server's
AugmentedLiquidSourceCode so it is memoized per file version and
invalidated automatically when a document changes. Eliminates the
full-theme rescan that ran on every save. Also skips syntax-tree
parsing for Liquid files with no stylesheet tag, cutting first-save
and CLI-run costs.

Re-enables ValidScopedCSSClass in the recommended config, reversing
the temporary opt-out from #1180.

Fixes #1179.
aswamy added a commit that referenced this pull request Apr 23, 2026
Moves per-file CSS class extraction onto the language server's
AugmentedLiquidSourceCode so it is memoized per file version and
invalidated automatically when a document changes. Eliminates the
full-theme rescan that ran on every save. Also skips syntax-tree
parsing for Liquid files with no stylesheet tag, cutting first-save
and CLI-run costs.

Re-enables ValidScopedCSSClass in the recommended config, reversing
the temporary opt-out from #1180.

Fixes #1179.
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.

2 participants