-
Notifications
You must be signed in to change notification settings - Fork 379
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
feat: support Comment for Document #3496
Conversation
🦋 Changeset detectedLatest commit: 116f171 The changes in this PR will be included in the next version bump. This PR includes changesets to release 211 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #3496 +/- ##
==========================================
+ Coverage 57.59% 57.87% +0.27%
==========================================
Files 672 653 -19
Lines 17794 17188 -606
Branches 3876 3749 -127
==========================================
- Hits 10249 9948 -301
+ Misses 6934 6641 -293
+ Partials 611 599 -12
... and 125 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
@@ -49,6 +49,8 @@ import { Html, Body, Root, Head, Scripts } from '@modern-js/runtime/document'; | |||
|
|||
- `Scripts`:构建产生的 script 内容,可用于调整构建产物的位置,默认放在 `<Head>` 组件中。 | |||
|
|||
- `Comment`:将用户编写的 `<!-- gateway -->` 这种注释,保留输出到最新渲染的 html 中。 |
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.
We should add english document too
Summary
Support Comment component in Document.tsx file which could be stay the user's comment in the finall html.
🤖 Generated by Copilot at 77e4d47
This pull request adds a new feature to the plugin-runtime that allows inserting and decoding comments in the HTML output. It introduces a new
Comment
component that renders comments as encoded placeholders, and a new CLI option that decodes them. It also updates the integration tests to cover this feature.Details
🤖 Generated by Copilot at 77e4d47
Comment
component to render encoded HTML comments in the document head or body (link, link, link, link)document/constants.ts
file to define and access the encoded comment placeholders (link, link)renderHtml
function in thedocument/cli/index.ts
file to decode and replace the encoded comments in the HTML output (link)tests/integration/app-document/tests/index.test.js
file to verify the comment rendering feature (link)tests/integration/app-document/tests/index.test.js
file (link, link)Related Issue
#3495
Checklist
pnpm run change
.