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

推荐订阅源

Spread Privacy
Spread Privacy
K
Kaspersky official blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Forbes - Security
Forbes - Security
Hacker News - Newest:
Hacker News - Newest: "LLM"
The Last Watchdog
The Last Watchdog
SecWiki News
SecWiki News
Attack and Defense Labs
Attack and Defense Labs
Google DeepMind News
Google DeepMind News
Security Archives - TechRepublic
Security Archives - TechRepublic
S
Secure Thoughts
WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
Security Latest
Security Latest
TaoSecurity Blog
TaoSecurity Blog
Cyberwarzone
Cyberwarzone
S
SegmentFault 最新的问题
Cloudbric
Cloudbric
aimingoo的专栏
aimingoo的专栏
S
Schneier on Security
N
Netflix TechBlog - Medium
MyScale Blog
MyScale Blog
T
The Blog of Author Tim Ferriss
H
Hacker News: Front Page
C
Cybersecurity and Infrastructure Security Agency CISA
小众软件
小众软件
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
AWS News Blog
AWS News Blog
AI
AI
G
GRAHAM CLULEY
IT之家
IT之家
P
Privacy & Cybersecurity Law Blog
L
Lohrmann on Cybersecurity
Last Week in AI
Last Week in AI
D
Docker
Recent Announcements
Recent Announcements
O
OpenAI News
T
Threat Research - Cisco Blogs
GbyAI
GbyAI
S
Security @ Cisco Blogs
T
Troy Hunt's Blog
C
Check Point Blog
博客园 - 三生石上(FineUI控件)
A
About on SuperTechFans
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
N
News and Events Feed by Topic

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! Announcing WebContainers Astro support! 🛰 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
Tomek Sułkowski · 2020-11-20 · via StackBlitz Blog

Creating documentation used to be extremely important in every engineering endeavor, but now, when so many teams work remotely, it’s pretty much a critical aspect of our work. As software engineers, we are used to reading docs – and sometimes, reading is enough: you just remember some method’s parameters, and that’s it – go back to your code and use it.

But quite often it’s far more beneficial to see an example code being actually evaluated, see the results… and maybe even edit it a bit to compare the changes. You might have seen some open-source projects (eg. TypeScript or Svelte) already including a kind of embedded playgrounds on their documentation pages. But building your own solution from scratch is a venture which not a lot of teams can afford.

Because of this, design systems teams many of the world’s largest companies in addition to the maintainers of many popular OSS projects have adopted StackBlitz to power their interactive documentation. This year in particular we’ve seen a substantial increase in usage (over 2 million developers per month!). In this post we want to share how our users are accelerating their docs learning experiences, and how you can too!

Breaking down into nuts and bolts

We’ll get to the nitty-gritty in a moment, but here’s a short overview of what we are talking about here:

  • StackBlitz is an extremely fast and lightweight online IDE with a built-in compiler/dev-server for JavaScript & TypeScript projects
  • @stackblitz/sdk is a 3kb JS library that allows you to programmatically create & embed such environments
  • Where it excels is wherever having a live example will enrich your library’s documentation

Who’s using it?

Before diving in, you might wonder if this is something that’s even worth the effort, and the easiest way to gauge that is by seeing if other companies and projects are already successfully using this tool. The answer is: totally!

Here are some of the most notable places to get you started:

… to name a few 🙂

So how do I start?

Either npm install @stackblitz/sdk or just add the script to your page:

<script
  src="https://unpkg.com/@stackblitz/sdk/bundles/sdk.umd.js">
</script>

and now you can use the global StackBlitzSDK object to take full control over the StackBlitz VM! Using that you can:

  • open a new project in a new tab
  • embed a project on the current page
  • open or embed GitHub repositories
  • and more!

How you proceed depends on your specific circumstances – we’ve worked hard to make the SDK as flexible as possible, so to learn more take a peek at the SDK documentation.

Wait… is that it?

Pretty much! 😅

But hey, just to show you that it really is that simple, here’s a minimal example:

StackBlitzSDK.openProject({
  files: {
    'index.html': `<h1>Hello world!</h1>`,
    'index.js': `alert('Woohoo! We can start documenting!')`
  },
  template: 'javascript',
  description: `My First Docs!`,
});

💡 We have just bound this code to a click event on the following , so you can actually click it (go ahead!) and see the demo opening in the new tab. Nifty! 😃


It is really an amazing experience for a developer to be able to tinker with code they’re reading about, without having to set all kinds of boilerplate up. If you want to make your documentation this much richer my advice is: just try it. Add it in one crucial place – maybe the most used example, or maybe the most complex one. Discuss it with your team, ask your users for their opinion, and I bet you will fall in love with it as much as we & millions of others have!

And if you have any questions, don’t hesitate to contact me at tomek in the @stackblitz.com domain or drop into my Twitter DM (@sulco).

Let’s work on the docs!

Founding Engineer & DevRel at StackBlitz. Let's talk about docs, live examples, teaching, and experimenting in browsers!