-
Notifications
You must be signed in to change notification settings - Fork 24
feat(web-generator): update deprecation alertbox #518
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Pull request overview
This PR enhances the deprecation documentation generator to display different alert box colors based on the deprecation type. Instead of showing all deprecation types with a red "danger" alert, the system now maps "Documentation" and "End-of-Life (Compilation)" types to blue "info" alerts, "Runtime" and "Runtime (Application)" types to orange "warning" alerts, and falls back to red "danger" for other types.
- Extracts and parses deprecation type text from various node types (text, inlineCode, links)
- Implements conditional logic to map deprecation types to appropriate AlertBox severity levels
- Adds comprehensive unit tests to verify the type-to-level mapping behavior
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/generators/jsx-ast/utils/buildContent.mjs | Adds text extraction and type matching logic to determine AlertBox level based on deprecation type keywords |
| src/generators/jsx-ast/utils/tests/transformHeadingNode.test.mjs | New test suite covering the three main code paths: info level (documentation), warning level (runtime), and danger level (fallback) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #518 +/- ##
==========================================
+ Coverage 79.97% 80.72% +0.74%
==========================================
Files 127 128 +1
Lines 12276 12378 +102
Branches 866 887 +21
==========================================
+ Hits 9818 9992 +174
+ Misses 2455 2383 -72
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@AugustinMauroy Can you rebase so that #517 compares the build size here? |
67cfb85 to
5b5f601
Compare
|
| File | Base | Head | Diff |
|---|---|---|---|
deprecations.html |
471.63 KB | 471.57 KB | -59.00 B (-0.01%) |
deprecations.js |
256.87 KB | 256.81 KB | -59.00 B (-0.02%) |
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.
I'm putting an explicit blocker on this until:
-
Either
transformNodeToStringis used, ornodes[0].valueis used.nodes[0].valueshould be sufficient, since the node immediately following the prefix slicing is the deprecation type. -
getLevelFromDeprecationTypedoes not use.includesto find words. This is extremely prone to false positives. I'd prefer usingnodes[0].value.startsWithor similar, since we know the nodes should start with the type.- While it's possible (and I haven't checked) that some nodes don't follow this rule due to inconsistencies in core, I'd much rather fix those inconsistencies in core, than make a too-loose check here.
ovflowd
left a comment
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.
SGTM but left some comments.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Co-Authored-By: Aviv Keller <me@aviv.sh> Co-Authored-By: Claudio Wunder <cwunder@gnome.org>
d9dae9f to
df57c7a
Compare
|
I was able to fix it,
|
ovflowd
left a comment
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.
SGTM!
cc @avivkeller could you give a re-review?
Description
I'm back here 😁
I was reading this page using beta so need to fix this issue
Validation
Related Issues
close #419
Check List
node --run testand all tests passed.node --run format&node --run lint.