Refactor canvas single vite config
English | 简体中文
PR
PR Checklist
Please check if your PR fulfills the following requirements:
- [x] 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)
- [x] Built its own designer, fully self-validated
PR Type
What kind of change does this PR introduce?
- [ ] Bugfix
- [x] 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:
Summary
内容:
- 画布内的render单独构建成应用 base64内嵌到画布的lib构建产物中
- 画布连接src开发的时候,引用一个esbuild external掉的插件,并且给画布内外分开设置importmap
- 画布去掉内置tinyVue组件库的内置逻辑,bundle.json增加tinyVue组件的所有script和css
额外的内容:
- 修复众多package.json缺包, 去掉devAlias能发现缺很多包
- ~~devAlias缺toolbar/lock,补充回去~~
- 物料bundle.json,env环境变量全部切到 unpkg.com (npm.onmicrosof.cn已经不可用,没有意义了)
- 去掉了designer-demo build脚本后面的--mode 会导致读取不到变量
Does this PR introduce a breaking change?
- [ ] Yes
- [x] No
Other information
Summary by CodeRabbit
Summary by CodeRabbit
-
New Features
- Updated content delivery network (CDN) settings to enhance resource accessibility and loading times for both alpha and production environments.
- Introduced new functions and configurations to streamline canvas initialization and import map management.
- Added peer dependencies for enhanced localization and icon support across various packages.
- Launched a new Vite plugin to manage entry points and asset handling in a modular fashion.
-
Bug Fixes
- Improved iframe rendering by using
srcdoc, enhancing performance.
- Improved iframe rendering by using
-
Chores
- Updated various dependency versions and configurations, ensuring compatibility with new features and improvements.
Walkthrough
The recent changes primarily involve transitioning resource URLs from a proprietary CDN to the public CDN unpkg.com, enhancing accessibility for development and production environments. Several new files and functions have been added to improve modularity and dependency management. Additionally, updates to package configurations across multiple modules streamline the development process and ensure compatibility with newer components and libraries.
Changes
| Files & Directories | Change Summary |
|---|---|
designer-demo/env/.env.alpha, designer-demo/env/.env.production, packages/engine-cli/template/designer/env/.env.alpha, packages/engine-cli/template/designer/env/.env.production |
Updated VITE_CDN_DOMAIN from https://npm.onmicrosoft.cn to https://unpkg.com for broader resource accessibility. |
designer-demo/public/mock/bundle.json, packages/engine-cli/template/designer/public/mock/bundle.json |
Changed URLs from npm.onmicrosoft.cn to unpkg.com for scripts and styles; set version to 3.14.0 for components. |
packages/blockToWebComponentTemplate/vite.config.js, packages/build/vite-config/index.js, packages/build/vite-config/package.json, packages/build/vite-config/src/canvas-dev-external.js, packages/build/vite-config/src/default-config.js |
Various configuration updates including added exports and new dependencies to enhance modularity and functionality. |
packages/canvas/* (multiple files including DesignCanvas.vue, init-canvas.js, etc.) |
Introduced new functions for canvas initialization and import mapping; updated existing logic for improved clarity. |
packages/plugins/*/package.json |
Added @opentiny/vue-icon as a peer dependency with version ^3.14.0 across multiple plugins. |
packages/settings/*/package.json |
Introduced new peer dependencies like @opentiny/vue-renderless and @opentiny/vue-icon with version ^3.14.0. |
packages/canvas/scripts/vite-plugin-separate-build.js |
Introduced a new Vite plugin for managing modular entry point builds and asset handling. |
packages/canvas/README.md |
Updated documentation to clarify module architecture and setup instructions for development and debugging. |
Sequence Diagram(s)
sequenceDiagram
participant User
participant App
participant CDN
participant Component
User->>App: Request Resource
App->>CDN: Fetch Resource
CDN-->>App: Return Resource
App->>Component: Load Resource
Component-->>User: Render Component
Poem
🐇 In a meadow where bunnies play,
Changes hop in, brightening the day.
From Microsoft clouds to unpkg's light,
Resources now load with pure delight!
New functions and styles, oh what a treat,
In the coding garden, our work is sweet! 🌼
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?
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>.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
@coderabbitaiin 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
@coderabbitaiin 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 generate interesting stats about this repository and render them as a table.@coderabbitai show all the console.log statements in this repository.@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 as PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile 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.