-
Notifications
You must be signed in to change notification settings - Fork 871
fix(preview-server): inline styles property detection, and different case property comparison #2600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: b8f2bfd The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 issues found across 6 files
Prompt for AI agents (all 3 issues)
Understand the root cause of the following 3 issues and fix them.
<file name="packages/preview-server/src/actions/email-validation/check-compatibility.ts">
<violation number="1" location="packages/preview-server/src/actions/email-validation/check-compatibility.ts:282">
Matching the raw property name against the camel-cased entry misses Tailwind (kebab-case) and string-literal style keys, so unsupported CSS properties slip through the compatibility check.</violation>
<violation number="2" location="packages/preview-server/src/actions/email-validation/check-compatibility.ts:312">
Directly comparing camel-cased caniemail names to the raw property name causes Tailwind and kebab-case inline style properties to be skipped, regressing the compatibility warning.</violation>
</file>
<file name="packages/preview-server/src/utils/caniemail/ast/get-used-style-properties.ts">
<violation number="1" location="packages/preview-server/src/utils/caniemail/ast/get-used-style-properties.ts:95">
Skip inline style properties whose key is computed instead of treating the identifier name as a literal CSS property.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
Meant to fix the compatibility checking issues mentioned in #2595.
The problems causing this were twofold:
styleattribute, it was only counting for variable uses, such asjustifyContentcoming from the JSX, that was supposed to only be done to the snake-cased one coming from caniemail's data. This caused the comparison to just fail for properties such asjustifyContent/alignItems, which were the case for the issue.This pull request also includes tests for the former problem, but not the latter, since it doesn't seem to be very trivial to test with the way we have things setup. We'd need to break code up a bit more than right now.
Summary by cubic
Fix compatibility checking in the preview server by correctly reading inline style object properties and comparing property names consistently. Unsupported properties like justifyContent/justify-content and alignItems are now detected.
Bug Fixes
Dependencies