Skip to content
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

Improved backward compatibility #11

Merged
merged 1 commit into from
Sep 24, 2024
Merged

Improved backward compatibility #11

merged 1 commit into from
Sep 24, 2024

Conversation

black7375
Copy link
Contributor

@black7375 black7375 commented Sep 24, 2024

Description

To improve backward compatibility, we have made some changes to the RFC and made the cssVariants API clearer in the existing document.

Summary by CodeRabbit

  • New Features

    • Introduced cssVariants() function with examples for defining background variants.
    • Added backward compatibility for the base field in Vanilla Extract's recipes, enhancing functionality in the rules() function.
  • Bug Fixes

    • Corrected inteface to interface in the MyRulesProps interface for proper TypeScript syntax.
  • Documentation

    • Updated documentation to include new features and examples related to cssVariants() and base field usage.

Copy link

changeset-bot bot commented Sep 24, 2024

⚠️ No Changeset found

Latest commit: 8035fa6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

Copy link

coderabbitai bot commented Sep 24, 2024

Walkthrough

The pull request introduces significant changes across two documentation files. It establishes an alias for the cssVariants() function to styleVariants(), providing examples for its usage. Additionally, it enhances backward compatibility for the base field in Vanilla Extract's recipes, correcting syntax errors in TypeScript interfaces and updating the structure of variant definitions.

Changes

File Change Summary
text/000-css-literals.md Introduced alias for cssVariants() to styleVariants(), added usage examples and defined SectionProps interface.
text/002-css-rules.md Added backward compatibility for the base field, corrected inteface to interface, and updated compoundVariants structure.

Possibly related PRs

  • CSS rules #10: The changes in this PR involve modifications to text/000-css-literals.md, which directly relate to the introduction of the cssVariants() function and its aliasing to styleVariants(), indicating a strong connection in terms of functionality and purpose.

Poem

In the garden where code does play,
A rabbit hops with joy today.
New variants dance, colors bright,
With cssVariants(), what a sight!
Syntax fixed, rules align,
Hooray for changes, all is fine! 🐇✨


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

graphite-app bot commented Sep 24, 2024

Your org has enabled the Graphite merge queue for merging into main

Add 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.

Copy link

Triggered from #11 by @​black7375.

Checking if we can fast forward main (5d8dd5d) to ve-rules (8035fa6).

Target branch (main):

commit 5d8dd5d552dc59bf36dcb8ad8eb971494786db4b (HEAD -> main, origin/main, origin/HEAD)
Author: JeongJun Jo <[email protected]>
Date:   Sun Aug 18 17:16:08 2024 +0900

    Add: Default Variants, Composition, RulesVariants

Pull request (ve-rules):

commit 8035fa6d1a84a315c84a8a98c9904a9e28b73b19 (pull_request/ve-rules)
Author: alstjr7375 <[email protected]>
Date:   Tue Sep 24 17:28:52 2024 +0900

    Fix: Improved backward compatibility

It is possible to fast forward main (5d8dd5d) to ve-rules (8035fa6). If you have write access to the target repository, you can add a comment with /fast-forward to fast forward main to ve-rules.

Copy link

@coderabbitai coderabbitai bot left a 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 (5)
text/000-css-literals.md (2)

524-541: LGTM! Clear example of cssVariants() usage.

The addition of cssVariants() as an alias to styleVariants() improves backward compatibility, which aligns well with the PR objectives. The provided example clearly demonstrates both the definition and usage of cssVariants(), including proper typing for the variant prop.

Consider adding a brief comment explaining that cssVariants() is an alias for styleVariants() to make it immediately clear to readers unfamiliar with Vanilla Extract. For example:

// cssVariants() is an alias for styleVariants()
const background = cssVariants({
  primary: { background: "blue" },
  secondary: { background: "aqua" }
});

524-541: Summary: Changes align well with PR objectives

The introduction of cssVariants() as an alias for styleVariants() and the accompanying example effectively address the PR's goal of improving backward compatibility. This addition provides a clear path for users to transition to or continue using the API in a backward-compatible manner.

As you continue to enhance backward compatibility, consider documenting any potential gotchas or migration paths for users transitioning from other CSS-in-JS solutions to this new API. This could be added to a separate migration guide or included in the RFC as a subsection on backward compatibility considerations.

text/002-css-rules.md (3)

377-400: LGTM! Great addition of backward compatibility.

The introduction of backward compatibility for the base field in Vanilla Extract's recipes is a valuable addition that aligns well with the PR objectives. The examples clearly demonstrate how to use the base field and explain its priority when used alongside other properties.

Consider adding language identifiers to the code blocks for better syntax highlighting. For example:

-```
+```typescript
 const myRule = rules({
   base {
     color: "blue",
     backgroundColor: "red"
   }
 });

This small change will improve the readability and consistency of the documentation.

<details>
<summary>Tools</summary>

<details>
<summary>Markdownlint</summary><blockquote>

377-377: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

</blockquote></details>

</details>

---

Line range hint `1137-1146`: **Improved example for future functional `rules()`.**

The correction of the `interface` typo and the updated example for functional `rules()` provide a clearer illustration of how this feature could work in the future. 



Consider adding a note to emphasize that this is a future possibility and not currently implemented. For example:

```markdown
> Note: The following is an example of a potential future implementation and is not currently available in the API.

This addition would help prevent any confusion for readers who might mistake this for a current feature.


377-377: Convert emphasis to proper heading for "Backward compatibility".

The static analysis tool flagged the use of emphasis (**) for "Backward compatibility". For better document structure and accessibility, it's recommended to use a proper heading instead.

Please update the line as follows:

-**Backward compatibility**
+### Backward compatibility

This change will improve the document's structure and make it easier to navigate.

Tools
Markdownlint

377-377: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5d8dd5d and 8035fa6.

Files selected for processing (2)
  • text/000-css-literals.md (1 hunks)
  • text/002-css-rules.md (4 hunks)
Additional context used
Markdownlint
text/002-css-rules.md

377-377: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

Additional comments not posted (2)
text/002-css-rules.md (2)

406-406: Good catch on the typo correction.

The change from inteface to interface is a necessary correction that improves the code quality and prevents potential confusion or errors.


689-692: Improved structure for compound variants.

The updated structure of the compoundVariants array is a positive change. Encapsulating the color and size properties within a variants object improves readability and aligns better with TypeScript syntax. This change also makes the code more consistent with other examples in the document.

Also applies to: 724-727

@black7375
Copy link
Contributor Author

/fast-forward

Copy link

Triggered from #11 (comment) by @​black7375.

Trying to fast forward main (5d8dd5d) to ve-rules (8035fa6).

Target branch (main):

commit 5d8dd5d552dc59bf36dcb8ad8eb971494786db4b (HEAD -> main, origin/main, origin/HEAD)
Author: JeongJun Jo <[email protected]>
Date:   Sun Aug 18 17:16:08 2024 +0900

    Add: Default Variants, Composition, RulesVariants

Pull request (ve-rules):

commit 8035fa6d1a84a315c84a8a98c9904a9e28b73b19 (pull_request/ve-rules)
Author: alstjr7375 <[email protected]>
Date:   Tue Sep 24 17:28:52 2024 +0900

    Fix: Improved backward compatibility

Fast forwarding main (5d8dd5d) to ve-rules (8035fa6).

$ git push origin 8035fa6d1a84a315c84a8a98c9904a9e28b73b19:main
To https://github.com/mincho-js/working-group.git
   5d8dd5d..8035fa6  8035fa6d1a84a315c84a8a98c9904a9e28b73b19 -> main

@github-actions github-actions bot merged commit 8035fa6 into main Sep 24, 2024
1 check passed
@black7375 black7375 deleted the ve-rules branch September 24, 2024 08:46
This was referenced Sep 26, 2024
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.

1 participant