Microsoft Fast Design
Howdy! I&#x27;m the architecture lead on FAST at Microsoft. There&#x27;s a great conversation here with lots of questions, so I thought I would chime in and try to clarify a few things.<p>The first point of note is that FAST is built on Web Component standards. I see a number of comments that indicate some folks aren&#x27;t familiar with Web Components. So, let me give a brief explanation.<p>First, the term &quot;Web Components&quot; is an umbrella term. You may remember when the industry used to talk about &quot;HTML5&quot;. This was also an umbrella term for a collection of new HTML standards. Similarly, &quot;Web Components&quot; refers to a collection of standards related to creating reusable custom HTML elements. Some of the standards that are under the umbrella include the ability to define new custom element tags, a standard component lifecycle, encapsulated HTML rendering and encapsulated CSS (shadow dom), CSS properties, CSS Shadow Parts, and more. These are all defined by W3C and have shipped in all major browsers today. The work on Web Component standards, like the rest of the web, is ongoing. New APIs continue to be designed and released. Some recent APIs include form associated custom element APIs and CSS Shadow Parts. W3C is currently working on standards for things like constructible style sheets, declarative Shadow DOM, custom element registries, custom states&#x2F;pseudo selectors, and more. Microsoft, Google, Salesforce, and many others are working together on this.<p>Because FAST is built on Web Components, it does not create its own component model; it&#x27;s using the standard component model. What has traditionally been thought of as a &quot;front-end framework&quot; typically has its own component model, not based on web components. Examples of this include Angular, React, Vue, Svelte, etc. Any library that is based on web components isn&#x27;t trying to create its own model, but rather to leverage the standards. This allows a web component to work like any normal HTML element. You do not need a framework to use them. However, if you want, you can use them in combination with a framework of your choice, or jQuery, or whatever.<p>To drive the point home that these are web standards, here are 4 lines of code that you can execute in a modern browser console to define, create, and add a web component. You can even execute it in this Hacker News page using DevTools.<p>&#x2F;&#x2F; define the custom element class<p>class HelloWorld extends HTMLElement { constructor() { super(); this.attachShadow({ mode: &#x27;open&#x27; }).innerHTML = &#x27;Hello World&#x27;; } }<p>&#x2F;&#x2F; register the custom element by tag name<p>customElements.define(&#x27;hello-world&#x27;, HelloWorld);<p>&#x2F;&#x2F; create an instance of your new element<p>const ele = document.createElement(&#x27;hello-world&#x27;);<p>&#x2F;&#x2F; add your new element to the body<p>document.body.appendChild(ele);<p>If you do this in your console now, you&#x27;ll be able to scroll down to the end of the page and see your component rendering. Have a look in the element inspector and you&#x27;ll see the custom tag, along with its shadow dom, including &quot;Hello World&quot;.<p>When you start to build web components, you&#x27;re likely to notice that there&#x27;s a pretty large amount of code you need to write to implement even a basic component. That&#x27;s because the standard defines low-level protocols, rather than high-level abstractions. By doing this, the standard provides you with interoperability and flexibility to innovate without boxing you in. At this point, something like FAST comes along and provides a thin layer of opinions, lifting the level of abstraction just enough to make it easier and FASTer to build components. Things that FAST helps with include: providing attribute&#x2F;property syncing, rich Model-View-ViewModel (MVVM), template rendering&#x2F;update, style composition, etc. All of this is an internal implementation detail of a FAST component, allowing FAST to integrate with Web Components built in completely different ways or with different libraries. The entire fast-element library, without tree-shaking, is around 10kb minified and GZipped. It was designed for tree-shaking from the beginning, so any feature you don&#x27;t use when building a component will be removed during build, allowing you to get it smaller based on your needs.<p>Architecturally, today FAST is composed of 3 layers. At the lowest level is fast-element, which provides a basic mechanism for defining components. For many people, this is all they need. However, others need an actual component library to build their site&#x2F;app with, and often times they need control over the look&#x2F;feel&#x2F;branding. To address this, you can add the second layer, fast-foundation, which provides a set of building blocks for creating component libraries and design systems. It itself is not a component library. Rather, it has the base behaviors for standard components like button, tree view, menu, etc. It also has the basic functionality that design systems typically need, such as color algos, design tokens (design variables), typography primitives, etc. Foundation allows you to build your own button, tree-view, etc, without having to design the semantic HTML, work out the correct Aria behaviors, mess with proper keyboard nav, manage the JavaScript state and behavior, etc. Instead, you can compose together a foundation button and foundation template with your own styles, giving you complete control over the appearance of your components. With these building blocks, it&#x27;s possible to implement something like Bootstrap, Material Design, Lightning, etc. However, if you don&#x27;t need to implement your own design system, you can use one that we build. This is the third layer. We provide two design systems today. One is called FAST Frame (featured on our web site). The other is Fluent UI Web Components.<p>FAST Frame is an early, experimental design system that our team is working on. I saw some feedback below that it&#x27;s &quot;ugly&quot; :‑D As mentioned, this design system is a work in progress, being designed and developed in the open. So, we welcome you to contribute to the project and help us define something that the industry would feel proud to use in their apps. As for Fluent UI Web Components, Fluent UI is Microsoft&#x27;s design language. I saw some comments below about how Microsoft was trying to consolidate and that FAST seems to add yet another option. The consolidation work is around our design system first. So, we&#x27;re moving to a single design system &quot;Fluent UI&quot; across the company. We&#x27;re then consolidating implementations as appropriate. Previously, there were several React implementations. There&#x27;s work ongoing to consolidate that into a single React implementation. But what about people who don&#x27;t use React? Well, that&#x27;s what Web Components are for. FAST is providing the Fluent UI Web Components implementation. So, regardless of what platform, framework, etc. you use there will be a best fit implementation that provides you with a consistent Fluent UI experience.