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 4 commits into
base: master
Choose a base branch
from
Open

feat: es module sandbox #2064

wants to merge 4 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沙盒

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
Base automatically changed from feature/2.4.0 to master June 27, 2024 09:15
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.

1 participant