Let’s suppose for a moment that you’ve spent any time developing with frameworks such as React. In that case, I’m sure you will have come across the principle of creating web components. We can drop these self-contained, reusable packages of code into any number of projects, with only minor tweaks needed to configure the package for your project. Sound familiar? What if we found ourselves reusing them over multiple projects? The problem is that using React means you are stuck with React components – what if we could create one that is framework-agnostic? We can, with Svelte, and it’s a perfect call to build a web component library! In this chapter, I’ll take you through what web components are and an overview of the Cobalt library, which is what we will create, so we can get set up to begin to create web components using Svelte.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Getting Started

  • Alex Libby

摘要

Let’s suppose for a moment that you’ve spent any time developing with frameworks such as React. In that case, I’m sure you will have come across the principle of creating web components. We can drop these self-contained, reusable packages of code into any number of projects, with only minor tweaks needed to configure the package for your project. Sound familiar? What if we found ourselves reusing them over multiple projects? The problem is that using React means you are stuck with React components – what if we could create one that is framework-agnostic? We can, with Svelte, and it’s a perfect call to build a web component library! In this chapter, I’ll take you through what web components are and an overview of the Cobalt library, which is what we will create, so we can get set up to begin to create web components using Svelte.