-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix: Typescript syntax, typos #13
Conversation
|
Your org has enabled the Graphite merge queue for merging into mainAdd the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
WalkthroughThe pull request introduces extensive revisions to documentation on CSS handling in TypeScript, focusing on the Changes
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Triggered from #13 by @black7375. Checking if we can fast forward Target branch ( commit a9f6f1b38bb1c84d4c8ae75660f91271994453ee (HEAD -> main, origin/main, origin/HEAD)
Author: MS_Y <[email protected]>
Date: Thu Sep 26 19:28:07 2024 +0900
Fix: Compiled css syntax Pull request ( commit 55ab16a3f934c059b4b4d7dd3953ebca290bb93c (pull_request/ts-compile)
Author: alstjr7375 <[email protected]>
Date: Wed Oct 2 17:44:44 2024 +0900
Fix: Typescript syntax, typos It is possible to fast forward |
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (14)
text/000-css-literals.md (2)
522-524
: LGTM: Backward compatibility measures are well-considered.The backward compatibility approach is well-thought-out, ensuring a smooth transition for existing Vanilla Extract users. Aliasing
css()
tostyle()
andcssVariants()
tostyleVariants()
maintains API consistency.For consistency with the rest of the document, consider removing the backticks around
vars:
andselectors:
on line 523:-- Should be support [`vars: `](https://vanilla-extract.style/documentation/styling#css-variables) and [`selectors: `](https://vanilla-extract.style/documentation/styling#complex-selectors) properties +- Should be support [vars:](https://vanilla-extract.style/documentation/styling#css-variables) and [selectors:](https://vanilla-extract.style/documentation/styling#complex-selectors) properties🧰 Tools
🪛 Markdownlint
523-523: null
Spaces inside code span elements(MD038, no-space-in-code)
523-523: null
Spaces inside code span elements(MD038, no-space-in-code)
Line range hint
1-651
: Excellent RFC: Comprehensive and well-structured proposal for CSS-in-TypeScript syntax.This RFC presents a thorough and well-considered proposal for a new CSS-in-TypeScript syntax. The document is well-structured, providing clear motivation, detailed explanations with examples, and a thoughtful discussion of drawbacks and future possibilities.
Consider the following minor improvements for clarity and completeness:
- Add a table of contents at the beginning of the document for easier navigation.
- In the "Unresolved questions" section, consider adding a brief discussion on the performance implications of the proposed syntax compared to existing solutions.
- In the "Future possibilities" section, you might want to mention potential integration with existing TypeScript tooling and IDE support for the new syntax.
These additions would further enhance the already comprehensive nature of the RFC.
text/001-css-nesting.md (6)
Line range hint
584-615
: LGTM! Clear explanation of nesting order.The proposed order for stabilizing nested structures is well-reasoned, considering both performance and readability. The explanation for each level (At-Rules and selectors) is clear and justified.
Consider adding a brief summary table or diagram at the end of this section to visually represent the nesting order. This could help readers quickly grasp the concept.
Line range hint
616-664
: LGTM! Clear demonstration of nesting order application.The example effectively shows how the proposed nesting order is applied in practice. The conversion to Vanilla Extract correctly follows the established order, providing a clear illustration of the concept.
Consider adding brief comments within the Vanilla Extract example to explain each nesting level. This could help readers understand how each part of the nested structure corresponds to the proposed order.
Line range hint
666-667
: Consider expanding the Drawbacks section.While the mentioned drawback is valid, this section could benefit from more elaboration. Consider discussing:
- Potential performance implications of deep nesting.
- Challenges in debugging deeply nested styles.
- Learning curve for developers new to this syntax.
- Possible mitigation strategies for each drawback.
Expanding this section would provide a more balanced view of the proposal and help address potential concerns.
Line range hint
669-778
: LGTM! Comprehensive comparison with alternatives.This section effectively compares the proposed syntax to existing preprocessors and provides well-explained alternatives. The examples for Partial Reference and Path-like Reference are particularly helpful in understanding the design decisions.
Consider adding a brief summary at the end of this section that clearly states why the proposed approach was chosen over the alternatives. This would help reinforce the rationale behind the design decisions.
Line range hint
780-783
: Consider expanding the Unresolved questions section.While the concern about type-safety is valid, this section could benefit from more specific questions or areas of uncertainty. Consider adding:
- Specific challenges in implementing type-safety for nested syntax.
- Potential edge cases that need further investigation.
- Questions about performance implications of the proposed syntax.
- Compatibility concerns with existing tools or workflows.
Expanding this section would help identify areas that need further research or discussion before implementation.
Line range hint
784-791
: Consider expanding the Future possibilities section.While this section provides a glimpse into future developments, it could benefit from more details. Consider adding:
- A brief overview of how props handling might work in this context.
- Potential benefits of implementing SCSS @mixin-like and Stitches Variants-like features.
- How these future features might integrate with the current proposal.
- Any potential challenges or considerations for implementing these features.
Expanding this section would give readers a clearer picture of the long-term vision for this proposal and how it fits into the broader ecosystem.
text/002-css-rules.md (6)
495-496
: Good addition to demonstrate composition!The example effectively shows how
myRule
can be composed with other styles using thecss()
function. This is a crucial demonstration of how the newrules()
API integrates with existing patterns.To further improve clarity, consider adding a brief comment explaining the purpose of this composition, e.g.:
const myCSS = css([ myRule({ color: "red", background: "blue", size: "5px" }), { borderRadius: 999 } // Additional styles can be composed directly ]);
725-726
: Improved clarity in compound variants exampleThe use of actual string values ("brand" and "small") instead of placeholders makes the example more concrete and easier to understand. This change enhances the readability of the document.
For consistency, consider using the same format for all examples in this section. For instance, you could update the second method example to use string values as well:
compoundVariants: ({ color, size }) => [ { condition: [color["brand"], size["small"]], style: { fontSize: "16px" } } ]
895-896
: EnhancedrulesVariants
example with more comprehensive styling optionsThe additions and modifications in this section significantly improve the
rulesVariants
example:
- Adding a 'medium' size variant provides a more complete set of size options.
- The new properties for the 'image' variant make it more realistic.
- The modifications to the 'detail' style variant offer more specific styling.
These changes make the example more representative of real-world usage, which is excellent for documentation purposes.
For consistency and to further improve the example, consider adding a 'medium' option to the 'style' variant of the 'image' as well. This would provide a complete set of options across all variants:
style: { thumbnail: { width: "50px" }, medium: { width: "65%" }, detail: { width: "80%", marginBottom: "10px" } }Also applies to: 905-906, 915-916
1001-1001
: Valuable reference to default implementation addedThe addition of the reference to the Vanilla Extract's recipes package as the starting point for the default implementation is excellent. This information is crucial for developers who might want to contribute or understand the internals of the proposed API.
To enhance this further, consider adding a brief explanation of why this particular implementation was chosen as the starting point. For example:
The default implementation starts with the [Vanilla Extract's recipes package](https://vanilla-extract.style/documentation/packages/recipes/) [code](https://github.com/vanilla-extract-css/vanilla-extract/tree/master/packages/recipes) due to its robust foundation and alignment with our goals for static extraction and type safety.
1050-1050
: Excellent addition addressing programmatically generated stylesThe new subsection on programmatically generated styles is a valuable addition to the "Drawbacks" section. It addresses a common use case that could be challenging with the proposed API and provides a clear example and solution.
To make this even more helpful, consider adding a brief explanation of the performance implications of using
props
for dynamic styles. For example:Note: While using `props` solves the issue of programmatically generated styles, be aware that it may have performance implications for highly dynamic scenarios with frequent updates. In such cases, consider batching updates or using alternative approaches for extremely dynamic content.This addition would help developers make informed decisions when dealing with highly dynamic styling scenarios.
Line range hint
1-1173
: Excellent RFC structure and contentThe overall structure and content of this RFC are commendable. It provides a comprehensive overview of the proposed
rules()
API, including:
- Clear motivation and benefits
- Detailed explanations with numerous code examples
- Honest discussion of drawbacks and limitations
- Exploration of future possibilities
This thorough approach will greatly aid developers in understanding and implementing the proposed API.
To further enhance the document's usability, consider adding a table of contents at the beginning. This would improve navigation, especially given the length and depth of the RFC. For example:
# Table of Contents 1. [Summary](#summary) 2. [Motivation](#motivation) 3. [Guide-level explanation](#guide-level-explanation) 4. [Reference-level explanation](#reference-level-explanation) 5. [Drawbacks](#drawbacks) 6. [Rationale and alternatives](#rationale-and-alternatives) 7. [Unresolved questions](#unresolved-questions) 8. [Future possibilities](#future-possibilities)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
- text/000-css-literals.md (2 hunks)
- text/001-css-nesting.md (2 hunks)
- text/002-css-rules.md (8 hunks)
🧰 Additional context used
🪛 Markdownlint
text/000-css-literals.md
523-523: null
Spaces inside code span elements(MD038, no-space-in-code)
523-523: null
Spaces inside code span elements(MD038, no-space-in-code)
🔇 Additional comments (2)
text/001-css-nesting.md (1)
Line range hint
1-791
: LGTM! Comprehensive and well-structured proposal.This proposal for CSS nesting and referencing in a CSS-in-JS context is thorough and well-explained. The document covers various features with clear examples and justifications. The nesting order stabilization is particularly well-thought-out and explained.
Key strengths:
- Clear examples for each proposed feature.
- Thoughtful consideration of performance and readability in nesting order.
- Comparison with existing solutions and alternatives.
Suggestions for improvement:
- Expand the Drawbacks, Unresolved questions, and Future possibilities sections for more comprehensive coverage.
- Consider adding visual aids (e.g., diagrams) to illustrate complex concepts like nesting order.
- Provide more context on how this proposal fits into the broader ecosystem of CSS-in-JS solutions.
Overall, this is a strong proposal that, with minor expansions, would provide a clear roadmap for implementing advanced CSS nesting and referencing features.
text/002-css-rules.md (1)
Line range hint
1-1173
: Excellent RFC with valuable improvementsThis RFC for the new
rules()
API is exceptionally well-crafted and comprehensive. The document effectively communicates the motivation, implementation details, and potential drawbacks of the proposed API. The changes reviewed in this pull request significantly enhance the quality and clarity of the RFC:
- Improved code examples in the Composition and Compound Variants sections make the concepts more concrete and easier to understand.
- Enhanced
rulesVariants
example provides a more realistic representation of real-world usage.- Added reference to the default implementation offers valuable context for developers.
- New subsection on programmatically generated styles addresses an important edge case.
These improvements contribute to making the RFC more robust and developer-friendly. The thorough exploration of future possibilities also sets a clear roadmap for potential enhancements.
Overall, this RFC provides an excellent foundation for implementing and adopting the proposed
rules()
API. The attention to detail and consideration of various use cases demonstrate a well-thought-out approach to enhancing CSS-in-JS capabilities.
/fast-forward |
Triggered from #13 (comment) by @black7375. Trying to fast forward Target branch ( commit a9f6f1b38bb1c84d4c8ae75660f91271994453ee (HEAD -> main, origin/main, origin/HEAD)
Author: MS_Y <[email protected]>
Date: Thu Sep 26 19:28:07 2024 +0900
Fix: Compiled css syntax Pull request ( commit 55ab16a3f934c059b4b4d7dd3953ebca290bb93c (pull_request/ts-compile)
Author: alstjr7375 <[email protected]>
Date: Wed Oct 2 17:44:44 2024 +0900
Fix: Typescript syntax, typos Fast forwarding $ git push origin 55ab16a3f934c059b4b4d7dd3953ebca290bb93c:main
To https://github.com/mincho-js/working-group.git
a9f6f1b..55ab16a 55ab16a3f934c059b4b4d7dd3953ebca290bb93c -> main |
Summary by CodeRabbit
New Features
css()
API.rules()
API for declarative style definitions, supporting static and dynamic styling.Documentation