Closed cheton closed 2 months ago
Open the branch in Web Editor • VS Code • Insiders
Open Preview
Latest commit: d4c7a032d56ba3f9cfa1a02cfafa6ba85bc37e05
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
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪ |
🧪 No relevant tests |
🔒 No security concerns identified |
⚡ Key issues to review None |
Category | Suggestion | Score |
Performance |
Define the icon components outside of the route objects to prevent unnecessary re-renders___ **Theicon property in the new sections uses an inline function to render the ListOpenIcon . This can lead to unnecessary re-renders. Consider defining the icon component outside of the route object to avoid this.** [packages/react-docs/config/sidebar-routes.js [44-66]](https://github.com/trendmicro-frontend/tonic-ui/pull/883/files#diff-60ec0437285b17a02f107ee8ed56a48e098bfebde4f8975790fb65d4055c23d8R44-R66) ```diff -icon: (props) => ( - Suggestion importance[1-10]: 8Why: The suggestion correctly identifies a performance issue with inline function definitions for icons, which can cause unnecessary re-renders. Implementing this change would improve the performance. | 8 |
Best practice |
✅ Move the "Major Updates and Breaking Changes" section to the top for better visibility___Suggestion Impact:The "Major Updates and Breaking Changes" section was moved to the top of the document, making it more prominent as suggested. code diff: ```diff +# Migrating From v1 to v2 + +⚠️ This guide outlines the necessary steps to migrate from Tonic UI v1 to v2. Please review the breaking changes and assess the compatibility with your current setup before proceeding with the upgrade. + +## Major Updates and Breaking Changes + +This section highlights the major updates and breaking changes in Tonic UI v2. ```it to the top of the document to ensure users see it first.** [packages/react-docs/pages/migration-guide/migrating-from-v1-to-v2.page.mdx [11-16]](https://github.com/trendmicro-frontend/tonic-ui/pull/883/files#diff-57dab2e256c8496dcbd4a148689569f6b144a7b7215abdc66bf145f3dcde61caR11-R16) ```diff +# Migrating From v1 to v2 + +⚠️ This guide outlines the necessary steps to migrate from Tonic UI v1 to v2. Please review the breaking changes and assess the compatibility with your current setup before proceeding with the upgrade. + ## Major Updates and Breaking Changes This section highlights the major updates and breaking changes in Tonic UI v2. ``` - [ ] **Apply this suggestion** Suggestion importance[1-10]: 6Why: The suggestion is valid as it improves the document structure by making important information about breaking changes more visible. However, the existing placement is not incorrect, so this is a moderate improvement. | 6 |
Enhancement |
Simplify the
___
**The `App` component can be simplified by using an arrow function with implicit return.**
[packages/react-docs/pages/contribution-guide/react-components-part-1-example.js [4-6]](https://github.com/trendmicro-frontend/tonic-ui/pull/883/files#diff-0b03141a92c6dffc5b115baca96d3d1a4b98b0895ed33d99e31df88616ab5ad1R4-R6)
```diff
-const App = () => (
- | 5 |
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 74.88%. Comparing base (
474fe55
) to head (7266c32
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
/help
Welcome to the PR Agent, an AI-powered tool for automated pull request analysis, feedback, suggestions and more.
Here is a list of tools you can use to interact with the PR Agent:
Tool | Description | Trigger Interactively :gem: |
---|---|---|
[DESCRIBE](https://pr-agent-docs.codium.ai/tools/describe/) | Generates PR description - title, type, summary, code walkthrough and labels | - [ ] Run |
[REVIEW](https://pr-agent-docs.codium.ai/tools/review/) | Adjustable feedback about the PR, possible issues, security concerns, review effort and more | - [ ] Run |
[IMPROVE](https://pr-agent-docs.codium.ai/tools/improve/) | Code suggestions for improving the PR | - [ ] Run |
[UPDATE CHANGELOG](https://pr-agent-docs.codium.ai/tools/update_changelog/) | Automatically updates the changelog | - [ ] Run |
[ADD DOCS](https://pr-agent-docs.codium.ai/tools/documentation/) 💎 | Generates documentation to methods/functions/classes that changed in the PR | - [ ] Run |
[TEST](https://pr-agent-docs.codium.ai/tools/test/) 💎 | Generates unit tests for a specific component, based on the PR code change | - [ ] Run |
[IMPROVE COMPONENT](https://pr-agent-docs.codium.ai/tools/improve_component/) 💎 | Code suggestions for a specific component that changed in the PR | - [ ] Run |
[ANALYZE](https://pr-agent-docs.codium.ai/tools/analyze/) 💎 | Identifies code components that changed in the PR, and enables to interactively generate tests, docs, and code suggestions for each component | - [ ] Run |
[ASK](https://pr-agent-docs.codium.ai/tools/ask/) | Answering free-text questions about the PR | [*] |
[GENERATE CUSTOM LABELS](https://pr-agent-docs.codium.ai/tools/custom_labels/) 💎 | Generates custom labels for the PR, based on specific guidelines defined by the user | [*] |
[CI FEEDBACK](https://pr-agent-docs.codium.ai/tools/ci_feedback/) 💎 | Generates feedback and analysis for a failed CI job | [*] |
[CUSTOM PROMPT](https://pr-agent-docs.codium.ai/tools/custom_prompt/) 💎 | Generates custom suggestions for improving the PR code, derived only from a specific guidelines prompt defined by the user | [*] |
[SIMILAR ISSUE](https://pr-agent-docs.codium.ai/tools/similar_issues/) | Automatically retrieves and presents similar issues | [*] |
(1) Note that each tool be triggered automatically when a new PR is opened, or called manually by commenting on a PR.
(2) Tools marked with [*] require additional parameters to be passed. For example, to invoke the /ask
tool, you need to comment on a PR: /ask "<question content>"
. See the relevant documentation for each tool for more details.
/improve
/ask Review the contribution guide and migration guide and offer suggestions if needed
Review the contribution guide and migration guide and offer suggestions if needed
Section Titles and Structure:
Import Paths:
import BorderedBox from '../../components/BorderedBox';
) are necessary for consistency and correctness. Ensure all paths are updated uniformly across the documentation.Example Code:
react-components-part-1-example.js
file is helpful. It provides a clear, simple example of how to use the Code
component.Detailed Steps:
Major Updates and Breaking Changes:
Component Deprecations:
- <Checkbox ref={checkboxRef} />
+ <Checkbox inputRef={checkboxRef} />
Component Modifications:
Code Examples:
- <Switch ref={switchRef} />
+ <Switch inputRef={switchRef} />
Deprecation Notices:
<TextLabel><Flex alignItems="center" columnGap="2x" mb="2x"><AlertIcon /> DEPRECATION NOTICE</Flex></TextLabel>
is a nice touch. It visually distinguishes important information.Consistency:
Navigation:
Examples and Use Cases:
Feedback Loop:
Overall, the updates to the contribution and migration guides are comprehensive and well-structured. With a few additional tweaks and enhancements, they will be even more user-friendly and effective.
/improve
Demo
https://trendmicro-frontend.github.io/tonic-ui-demo/react/pr-883
PR Type
Documentation, Enhancement
Description
Changes walkthrough 📝
index.page.mdx
Update v1 to v2 migration guide with component updates
packages/react-docs/pages/getting-started/migration-v1-to-v2/index.page.mdx