Skip to content
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: es module sandbox #2064

Open
wants to merge 11 commits into
base: feature/2.4.0
Choose a base branch
from
Open

feat: es module sandbox #2064

wants to merge 11 commits into from

Conversation

jeffwcx
Copy link
Collaborator

@jeffwcx jeffwcx commented Apr 1, 2024

🤔 这个变动的性质是?/ What is the nature of this change?

  • 新特性提交 / New feature
  • bug 修复 / Fix bug
  • 样式优化 / Style optimization
  • 代码风格优化 / Code style optimization
  • 性能优化 / Performance optimization
  • 构建优化 / Build optimization
  • 网站、文档、Demo 改进 / Website, documentation, demo improvements
  • 重构代码或样式 / Refactor code or style
  • 测试相关 / Test related
  • 其他 / Other

🔗 相关 Issue / Related Issue

💡 需求背景和解决方案 / Background or solution

将代码执行沙盒改为iframe sandbox,支持执行es module,支持import map编辑

功能预览:

一. 直接运行esm cdn
2024-04-01.21.36.28.mp4
二. 通过importmap引入依赖
2024-04-01.21.44.41.mp4

视频中的import map是一个扩展了builtins字段,但其实是不可编辑的,因为这是应用本身提供的

其他说明

相比commonjs沙盒,esm沙盒除了有以上好处,还可以进行一定的权限控制

但由于其兼容性还不够广泛,所以 一旦浏览器不支持importmap,dumi会退回到cjs沙盒

📝 更新日志 / Changelog

Language Changelog
🇺🇸 English use es module sandbox
🇨🇳 Chinese 使用es module沙盒

liuyib and others added 11 commits March 13, 2024 17:35
* fix: locale not work in demo

* refactor: update

* refactor: update
Bumps [ip](https://github.com/indutny/node-ip) from 1.1.8 to 1.1.9.
- [Commits](indutny/node-ip@v1.1.8...v1.1.9)

---
updated-dependencies:
- dependency-name: ip
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Peach <scdzwyxst@gmail.com>
* fix: trim

* fix: 兼容LiveDemo情况

---------

Co-authored-by: Peach <scdzwyxst@gmail.com>
* fix: theme-mobile sorce code editor style

* feat: move Tooltip to slots

* refactor: make tooltip as internal component

* chore: clear diff for pnpm-lock.yaml

* fix: mobile live demo

---------

Co-authored-by: PeachScript <scdzwyxst@gmail.com>
* feat: add createTechStack api

* refactor: change to defineTechStack, restore built-in ReactTechStack

* refactor: remain consistent with the original interface

---------

Co-authored-by: Peach <scdzwyxst@gmail.com>
Copy link

vercel bot commented Apr 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
dumi ❌ Failed (Inspect) Apr 1, 2024 1:51pm

@jeffwcx jeffwcx changed the base branch from master to feature/2.3.0 April 1, 2024 13:52
@jeffwcx jeffwcx requested a review from PeachScript April 1, 2024 14:01
@PeachScript PeachScript changed the base branch from feature/2.3.0 to feature/2.4.0 April 1, 2024 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants