-
Notifications
You must be signed in to change notification settings - Fork 287
Server-Side Rendering #160
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
remove custom XMLSerializer implementation in favor of native outerHTML move svgo optimization to CLI level with option
- Add fast fail for syntax errors - Validate template existence
This commit removes the standalone CLI module and moves examples to internal SSR tests for better integration.
Remove CLI tool documentation and references after CLI module removal, update SSR documentation, and remove teardownDOM function from exports.
Relocate SSR example files from __tests__/ssr/examples to __tests__/unit/ssr/examples and update test file path reference.
Summary of ChangesHello @lyw405, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 此拉取请求为信息图引入了服务端渲染(SSR)能力,使其能够在 Node.js 环境中渲染为 SVG 字符串。它重构了现有代码以支持此新功能,包括 DOM 环境模拟、资源预加载和专用的 SSR API。这些更改还包括全面的测试和更新的文档,以指导用户进行非浏览器渲染。 Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
这个 Pull Request 引入了服务端渲染(SSR)功能,这是一项重要且有价值的新特性。实现非常全面,不仅包括在 Node.js 环境中的核心渲染逻辑,还对现有代码库的多个部分(如资源加载、字体处理和文本测量)进行了调整,以同时支持浏览器和服务器环境。值得称赞的是,您添加了 DOM shim(linkedom)、SSR 的专项测试以及详尽的文档。代码质量很高,设计决策也很可靠。
我有一个关于在错误处理路径中提高类型安全性的建议。总的来说,这是一次出色的贡献。
Merged upstream main branch changes with SSR feature development. Changes merged: - Skills integration documentation and structure - Live editor implementation (#105) - Improved resource loading with caching and load tracking - Micro-app environment support - Added 'loaded' event for resource completion - Various UI/UX improvements Conflicts resolved: - README.md: Kept both SSR and Skills sections - dev/src/Infographic.tsx: Merged remote fetch with caching - dev/vite.config.ts: Added fs.allow and port config - src/renderer/renderer.ts: Merged SSR and micro-app support - src/resource/loader.ts: Merged load tracker logic - src/runtime/Infographic.tsx: Merged rendered and loaded events - dev/src/get-asset.ts: Removed (deleted in upstream)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #160 +/- ##
===========================================
+ Coverage 31.10% 44.71% +13.61%
===========================================
Files 321 324 +3
Lines 24860 25159 +299
Branches 1330 1902 +572
===========================================
+ Hits 7733 11251 +3518
+ Misses 17124 13898 -3226
- Partials 3 10 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Update various project files including configuration, SSR tests, and generated SVG outputs.
* Server-Side Rendering (#160) * feat(ssr): Implement SSR rendering pipeline * test(ssr): make renderer tests async and use string input format * refactor: remove unused code * ci: add CLI build step to workflow * fix: lint error * refactor(build): replace custom esm import fixer with tsc-alias * feat: export resource types * feat(ssr): add non-browser rendering documentation * feat(ssr): replace JSDOM with LinkeDOM * fix: ignore unused error parameter * test(ssr): remove debug console.log from renderer test * refactor(ssr): simplify SVG serialization and DOM setup remove custom XMLSerializer implementation in favor of native outerHTML move svgo optimization to CLI level with option * fix(ssr): improve error handling and validation in renderer - Add fast fail for syntax errors - Validate template existence * Refactor: move CLI to internal SSR tests and remove CLI module This commit removes the standalone CLI module and moves examples to internal SSR tests for better integration. * Update documentation and remove CLI references Remove CLI tool documentation and references after CLI module removal, update SSR documentation, and remove teardownDOM function from exports. * Move SSR examples test files to proper location Relocate SSR example files from __tests__/ssr/examples to __tests__/unit/ssr/examples and update test file path reference. * Update project configuration and SSR test outputs Update various project files including configuration, SSR tests, and generated SVG outputs. * Add render_error type and improve type safety in SSR renderer --------- Co-authored-by: Yrom <[email protected]> * revert: unnecessary changes * refactor(utils): optimize utils * refactor(ssr): optimize ssr implement * test(ssr): update test case and output * docs: update docs * refactor: optimize code * fix: fix cr issues * docs: remove trailing whitespace in index.en.md --------- Co-authored-by: YuwangLiu <[email protected]> Co-authored-by: Yrom <[email protected]> Co-authored-by: hustcc <[email protected]>
基于 yrom 提起的pr 剥离cli及其其他无关逻辑。close #104