Move the <style> attribute helpers into style-tag.js - #426
Merged
Merged
Conversation
hasScopedAttribute, getLangAttribute and hasInlineAttributeWithoutLang were private to template-plugin.js, and unplugin-colocated.js kept its own copy of the extensions Vite preprocesses. They answer the same question -- how a <style> block is read -- so they now live in one module. The module is exported as ember-scoped-css/__private_do_not_use_are_you_serious__/style-tag, a seam for stylelint-ember-scoped-css (auditboard#422), which needs the same answers and today has its own drifted copies of the first two. Not public API, and the path says so. It imports nothing, so a consumer does not pull the build pipeline in behind it. A move, nothing else: the four things are byte-identical to what they replace, and the same 203 tests pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
tylerturdenpants
force-pushed
the
style-tag-helpers
branch
from
September 4, 2026 20:59
b9dc8b7 to
8ff05d4
Compare
NullVoxPopuli
approved these changes
Sep 4, 2026
Merged
Contributor
Author
|
#422 is stacked on this one and is in draft until it lands, so this wants to go first. |
tylerturdenpants
added a commit
to tylerturdenpants/ember-scoped-css
that referenced
this pull request
Sep 4, 2026
Per review, ember-scoped-css should not take a semver bump on this PR's account. It no longer needs to: the only thing left in its diff was PREPROCESSED_LANGS, added so the syntax could ask "is this a preprocessor dialect", and nothing asks that any more. The suggestion was to chop the leading `.` off PREPROCESSED_EXTENSIONS in the plugin instead. That is not needed either, because the plugin does not want a list of dialects, it wants a lang-to-parser mapping, and which postcss parser reads scss is a stylelint concern rather than something the build can answer. That table lives in the plugin and is keyed by lang already. So style-tag.js goes back to main's version, literal extension Set and all, and PREPROCESSED_EXTENSIONS keeps its single consumer in unplugin-colocated.js. The private style-tag export this PR relies on is already on main from auditboard#426, so nothing in ember-scoped-css changes here. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out of #422 so that PR is only the stylelint support. No behaviour change here.
What moves
hasScopedAttribute,hasInlineAttributeWithoutLangandgetLangAttributewere private totemplate-plugin.js, andunplugin-colocated.jskept its own copy of the extensions Vite preprocesses. They answer the same question, how a<style>block is read, so they now live together insrc/build/style-tag.jsand their callers import them from there.All four are byte-identical to what they replace. I compared the parsed function bodies rather than reading the diff, so that is a check rather than a claim.
The export
ember-scoped-css/__private_do_not_use_are_you_serious__/style-tag.It is a seam for
stylelint-ember-scoped-css, which needs the same answers and today has its own drifted copies of the first two helpers. Not public API, and the path says so. The module imports nothing, so a consumer does not pull the build pipeline in behind it.Verified
main.pnpm buildclean.hasScopedAttribute,hasInlineAttributeWithoutLang,getLangAttributeandPREPROCESSED_EXTENSIONS.Relationship to #422
#422 is stacked on this branch. It adds
isPreprocessedand the dialect list behind it, which only the linter calls, so those stay there rather than landing here with no caller. Its diff will still show this commit until this merges, at which point I will rebase it.