Skip to content

feat: update changelog and playground #2612

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

Merged
merged 1 commit into from
Dec 5, 2024
Merged

Conversation

zzcr
Copy link
Member

@zzcr zzcr commented Dec 5, 2024

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Updated version management to include '3.20' as the latest version in the playground.
    • Enhanced theme management with streamlined import mapping based on the selected theme.
  • Bug Fixes

    • Improved conditional logic for menu generation, ensuring document menus are only generated in development environments.
  • Documentation

    • Clarified the process for version handling and theme application in the playground.

Copy link

coderabbitai bot commented Dec 5, 2024

Walkthrough

The changes in this pull request primarily involve updates to the App.vue and menus.jsx files. In App.vue, the version management is refined by updating the versions array and modifying functions to ensure correct retrieval and application of themes. In menus.jsx, the logic for generating document menu options is altered to conditionally enable this feature based on the development environment. These modifications streamline functionality and improve clarity in version handling and menu generation.

Changes

File Path Change Summary
examples/sites/playground/App.vue Updated versions array to include '3.20'; modified getVersion, createImportMap, getTinyTheme, setTinyDesign, and loadFileCode functions for improved version handling and theme management.
examples/sites/src/menus.jsx Altered genMenus function to conditionally generate document menu options based on import.meta.env.DEV.

Possibly related PRs

Suggested labels

documentation, enhancement

Suggested reviewers

  • kagol

🐰 In the playground where we hop and play,
Versions updated, hip-hip-hooray!
With themes aligned and menus neat,
Our code now dances to a joyful beat!
So let’s celebrate with a carrot or two,
For every change brings something new! 🌟


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.

@github-actions github-actions bot added the enhancement New feature or request (功能增强) label Dec 5, 2024
Copy link

github-actions bot commented Dec 5, 2024

[e2e-test-warn]
The component to be tested is missing.

The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug".

Please make sure you've read our contributing guide

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 (2)
examples/sites/playground/App.vue (2)

87-88: LGTM: Improved import map configuration

The refactored design import configuration is more concise and maintainable.

Consider extracting the version delimiter logic to a constant:

+const DESIGN_IMPORT_PATH = (theme, version) => 
+  `${cdnHost}/@opentiny/vue-design-${theme}${versionDelimiter}${version}/${fileDelimiter}index.js`

 if (['aurora', 'saas'].includes(tinyTheme)) {
-  imports[`@opentiny/vue-design-${tinyTheme}`] =
-    `${cdnHost}/@opentiny/vue-design-${tinyTheme}${versionDelimiter}${version}/${fileDelimiter}index.js`
+  imports[`@opentiny/vue-design-${tinyTheme}`] = DESIGN_IMPORT_PATH(tinyTheme, version)
 }

Line range hint 27-34: Fix: getVersion function logic error

The function has a bug where it's not returning the stored version due to incorrect if block structure.

Apply this fix:

 const getVersion = () => {
   if (isPreview) {
     return versions[0]
   }
   if (versions.includes(localStorage.getItem(VERSION))) {
-    localStorage.getItem(VERSION)
+    return localStorage.getItem(VERSION)
   }
   return versions[0]
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 5669126 and 7c7df76.

📒 Files selected for processing (2)
  • examples/sites/playground/App.vue (2 hunks)
  • examples/sites/src/menus.jsx (2 hunks)
🔇 Additional comments (2)
examples/sites/src/menus.jsx (1)

29-42: ⚠️ Potential issue

Breaking Change: Documentation menus are now DEV-only

This change removes documentation menus in production environments, which could impact user experience if documentation access was previously available in production.

Let's verify if this is intentional and if there are any existing uses of docOptions in production:

Consider:

  1. Adding a comment explaining why documentation menus are restricted to DEV
  2. Updating user documentation to reflect this change
  3. Adding a migration guide if this affects existing deployments
✅ Verification successful

Based on the comprehensive analysis of the codebase, I can now generate the final response:

DEV-only documentation is an intentional design pattern

The restriction of documentation menus to DEV environment is an intentional design pattern, as evidenced by:

  1. The React site implementation (examples/react-site/src/menus.jsx) shows docMenus are always included, indicating this is a Vue-specific design choice
  2. The mobile-first implementation (examples/sites/demos/mobile-first/menus.js) has an empty docMenus array by default
  3. The PC implementation (examples/sites/demos/pc/menus.js) contains the full documentation structure

This pattern aligns with common practices where documentation is available in development for reference but excluded from production builds to reduce bundle size.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any usage of docOptions or documentation-related menu items
rg -l "docOptions|使用指南|User Guide" --type vue --type jsx

Length of output: 86


Script:

#!/bin/bash
# Search for any usage of docOptions or documentation-related menu items
# Using broader file type patterns and checking the actual file content
rg -l "docOptions|使用指南|User Guide"

# Also check for the specific file to understand its full context
cat examples/sites/src/menus.jsx

Length of output: 2879


Script:

#!/bin/bash
# Let's check how docOptions is used in the application
rg "docOptions" -B 2 -A 2

# Also check if there's any documentation about DEV-only docs in README or other docs
fd README -e md -X cat {}

Length of output: 66142


Script:

#!/bin/bash
# Let's check how docMenus is used in the application and if there's any documentation about DEV-only behavior
rg "docMenus" -B 2 -A 2

# Also check for any configuration files that might control this behavior
fd -e config.js -e config.ts -X cat {}

Length of output: 44623

examples/sites/playground/App.vue (1)

Line range hint 26-34: Verify version compatibility and migration path

The version array update removes older versions ('3.17' and earlier). This could affect users on older versions trying to use the playground.

Let's check for any version-specific dependencies or features:

✅ Verification successful

The previous command failed because the file type 'vue' wasn't recognized. Let's try a broader search and also look for any configuration files that might contain version information. This will help us understand the version dependencies and potential migration impacts.


Based on the search results, I can now provide a final response regarding the version compatibility concern:

Version changes are safe and include proper migration path

The version array update from 3.17 to 3.20 is safe because:

  • The codebase shows a clear version progression (3.17 → 3.18 → 3.19 → 3.20) with all packages aligned at version 3.20.0
  • There is documented deprecation and migration path for older features (e.g., in milestone component from 3.17)
  • The CDN runtime support for 3.17 is maintained in the documentation (README.zh-CN.md)
  • The version check in the code includes a fallback to the latest version if an unsupported version is detected
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for version-specific imports or configurations
rg -A 3 "3\.1[7-9]|3\.20" --type vue --type js --type jsx

Length of output: 87


Script:

#!/bin/bash
# Search for version-specific imports or configurations with correct file extensions
rg -A 3 "3\.1[7-9]|3\.20" .

# Also check for any version-related configuration files
fd -e json -e yaml -e yml | xargs cat

Length of output: 65895

@kagol kagol merged commit 455668d into release-3.20.0 Dec 5, 2024
7 checks passed
kagol pushed a commit that referenced this pull request Dec 11, 2024
@kagol kagol deleted the update-change-log-1205 branch April 14, 2025 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request (功能增强)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants