Skip to content

fix: scope dynamic expressions#120

Merged
natemoo-re merged 2 commits intomainfrom
fix/dynamic-class
Oct 28, 2021
Merged

fix: scope dynamic expressions#120
natemoo-re merged 2 commits intomainfrom
fix/dynamic-class

Conversation

@natemoo-re
Copy link
Member

Changes

  • Previously, ternary expressions wouldn't work with our scoping approach.
  • This adds parens around expression values before appending our scoped class!

Testing

Test added

Docs

N/A, bug fix

@changeset-bot
Copy link

changeset-bot bot commented Oct 28, 2021

🦋 Changeset detected

Latest commit: b80e605

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/compiler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

case tycho.ExpressionAttribute:
// as an expression
attr.Val = attr.Val + ` + " astro-` + opts.Scope + `"`
attr.Val = "(" + attr.Val + `) + " astro-` + opts.Scope + `"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Genius!

Copy link
Member

@drwpow drwpow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix!

@drwpow
Copy link
Member

drwpow commented Oct 28, 2021

Needs a changeset

Copy link
Contributor

@jonathantneal jonathantneal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart!

@natemoo-re natemoo-re merged commit 04c1b63 into main Oct 28, 2021
@natemoo-re natemoo-re deleted the fix/dynamic-class branch October 28, 2021 15:38
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.

3 participants