惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Security Latest
Security Latest
C
Cisco Blogs
P
Palo Alto Networks Blog
Know Your Adversary
Know Your Adversary
Project Zero
Project Zero
C
Cyber Attacks, Cyber Crime and Cyber Security
NISL@THU
NISL@THU
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Secure Thoughts
P
Privacy International News Feed
V
Vulnerabilities – Threatpost
D
Docker
Google Online Security Blog
Google Online Security Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Recent Announcements
Recent Announcements
T
The Exploit Database - CXSecurity.com
G
Google Developers Blog
Schneier on Security
Schneier on Security
小众软件
小众软件
爱范儿
爱范儿
GbyAI
GbyAI
J
Java Code Geeks
T
Tailwind CSS Blog
Cisco Talos Blog
Cisco Talos Blog
The Hacker News
The Hacker News
D
DataBreaches.Net
Blog — PlanetScale
Blog — PlanetScale
TaoSecurity Blog
TaoSecurity Blog
MyScale Blog
MyScale Blog
B
Blog RSS Feed
Cyberwarzone
Cyberwarzone
有赞技术团队
有赞技术团队
Martin Fowler
Martin Fowler
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Securelist
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Y
Y Combinator Blog
S
Schneier on Security
Latest news
Latest news
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 叶小钗
F
Fortinet All Blogs
M
MIT News - Artificial intelligence
PCI Perspectives
PCI Perspectives
V
V2EX
V2EX - 技术
V2EX - 技术
O
OpenAI News
W
WeLiveSecurity

StackBlitz Blog

Cloudflare is now backing pkg.pr.new’s data infrastructure! Bolt 100K Open Source Fund ViteConf 2024 was a blast Unbundling the JavaScript ecosystem StackBlitz is joining the Open Source Pledge Announcing TutorialKit: Interactive tutorials in the browser Get ready for ViteConf 2024 Announcing pkg.pr.new StackBlitz welcomes Ari Perkkiö, core team member of Vitest Catch us at Figma Config WebContainers and the future of web dev (interview with Jòan Varvenne) Open Source at StackBlitz Avoiding CORS issues with this one simple trick How to document design system components What is Vite (and why is it so popular)? Improving the developer experience of enterprise design systems Flow state: Why fragmented thinking is worse than any interruption What is Storybook? An Overview for Developers The Self-Rendering Eval Shirt Starters Upgrade: WebContainers and Vite Putting the Dev in Figma’s Dev Mode Announcing StackBlitz Self-hosted Building Together in Illinois 5 lessons design systems teams can learn from open-source maintainers Announcing Native Language Support in WebContainers Introducing StackBlitz Teams ViteConf is back! Bringing Sharp to WebAssembly and WebContainers npm, yarn and pnpm are now supported natively in WebContainers The Atomic Waltz: Unraveling WebAssembly Issues in V8 and SpiderMonkey WebContainers now run on Safari, iOS, and iPadOS Now I am become the Destroyer of Threads WebContainer API is here. StackBlitz September 2022 Update StackBlitz August 2022 Update StackBlitz July 2022 Update Introducing: Collections and Social Previews! Down the caching-hole: adventures in Announcing ViteConf StackBlitz June 2022 Update The Fox and the Bolt: Bringing WebContainers to Firefox WebContainers are now supported in Firefox on desktop and Android StackBlitz May 2022 Update StackBlitz April 2022 Update Cloudflare and StackBlitz partner to bring Cloudflare Workers to your browser Powering over 2M developers a month, StackBlitz has raised $7.9M StackBlitz March 2022 Update Announcement: WebContainers are out of beta in Chromium StackBlitz has joined the Bytecode Alliance StackBlitz February 2022 Update Bringing WebContainers to all Browsers: a call to action for COEP Credentialless Cross-Browser support with Cross-Origin isolation StackBlitz welcomes Patak, core maintainer of Vite Chasing Memory Bugs through V8 and WebAssembly Remix v1 has landed, and it runs on WebContainers SvelteKit is now fully supported in WebContainers We Shopify partners with StackBlitz to bring Hydrogen development in-browser StackBlitz September 2021 Update Introducing Vite.new Templates! Introducing: SQLite3 support in WebContainers! 🧪 StackBlitz July 2021 Update StackBlitz June 2021 Update Introducing WebContainers: Run Node.js natively in your browser Interactive Docs: The new norm for Remote Work
Announcing WebContainers Astro support! 🛰
Fred K. Schott Creator of Astro · 2021-09-15 · via StackBlitz Blog

Today we are proud to share that our amazing engineering team have made all the necessary updates to the WebContainers platform – and the StackBlitz editor itself – needed to support Astro! 🚀 You can try it now!

Why are we hyped about Astro?

This minimalistic bundler provides a pretty unique approach to building websites. It’s focused on static HTML, striping all the JavaScript from your final build by default – and hence the fastest site loading experience possible! Great for your users, and SEO ❤️ (it will in fact even generate a sitemap and RSS feeds out of the box for you!)

But what if you do need some interactive features on your page? Instead of sending down all of the JavaScript that went into generated each page, Astro will only deliver and hydrate the components that actually are dynamic.

This approach is called Partial Hydration, and you can use it to design your website as a series of lightweight pages (with interactivity sprinkled in where needed) instead of a heavier JavaScript application.

For these interactive parts you can use React, Preact, Vue, Svelte, Web Components (in fact, you can use multiple at the same time!) – in JavaScript or TypeScript. And you can style it with Scoped CSS, CSS Modules, Sass, and others too!

And that’s not even all, so if you’re excited to learn more, visit the Astro Documentation.

The fact that StackBlitz runs Node.js entirely in your browser is mind-blowing.

Our users can now spin up any Astro starter project or example with StackBlitz in seconds!

How can you start?

  • As in a local environment, you can run npm init astro command in any WebContainer project
  • But the fastest way is to use this starter with all the files already prepared for you: https://stackblitz.com/fork/astro
  • You can also visit the official Astro examples repository, choose one of the setups and click “Open in StackBlitz” link in the example’s readme for a more specific starting point.

Open in StackBlitz

So what has changed on StackBlitz?

In order to support Astro, we needed to make several updates to WebContainers, including:

  • An opt-in support for dynamic imports in CommonJS via ENABLE_CJS_IMPORTS. You can set it up in your .stackblitzrc file like this:

    {
      "env": {
        "ENABLE_CJS_IMPORTS": true
      }
    }
    

    We’ve decided to make it an opt-in since it’s not a very common feature, but can introduce a performance penalty. The good news is, it’s only a temporary workaround, and the need for it will be removed by the Astro team in the next few weeks.

  • The possibility for ESBuild to work with synchronous compilation by turning off worker threads (The synchronous message passing is not supported by WebContainer as browsers don’t implement the necessary APIs for this. By turning worker threads off, it uses child processes)

  • Fixing an encoding issue when passing data between processes (Data was encoded incorrectly when it came back from the ESBuild child process and then it was interpreted incorrectly)

We’ve also honed the editor to handle .astro files by adding the textmate grammar support and a dedicated file icon.


We also want to give a huge shout out and thank you to the Astro team for all their help in making this happen!

If you’re an OSS maintainer and want to enable WebContainer support for your framework, my DMs are open!