-
Notifications
You must be signed in to change notification settings - Fork 601
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
The Future of FAST Foundation #5901
Comments
|
Another nice to have would be an option for the CLI to upgrade existing projects to the newer way of doing things. |
Great feedback @KingOfTac ! @janechu Can you capture the requests for the CLI? I think we have most of this on our list but just want to make sure we don't miss something. |
What about a generator for a standalone component with a convention that when followed enables that community component to be pulled into the design system project from the CLI? I was thinking about #3960 and how I might distribute such a thing in this new world. Something like For starters this could just copy the component and register it like the CLI will do with the original fast components. A pipe dream future enhancement could be missing token detection where any design tokens that the new component uses which do not match any in the current project could be raised by the CLI where the end-user is asked whether they want to add that token or substitute with an existing token. |
Great feedback. We had thought about supporting multiple project templates but this is more like being able to import a component template. Cool idea. Maybe we could support something like Gist, where you whatever files are in the gist get pulled in? /cc @janechu |
I'm really excited about the builder pattern for templates. We've needed to extend For extending and sharing CSS the builder pattern seems less urgently useful; this is because we've been able to leverage the existing |
Great to hear the builders will be valuable for you @jattasNI. We'll definitely have the template builder work first. I actually spent some time prototyping it today. A little more time next week and I think I will have nailed down the details enough for us to move ahead with that. On the CSS side, there's a lot more to work out, so I think that will probably be the last piece, and we'll likely need a bit more time to experiment with it and see what works. |
This is a well thought out write up. It sort of reminds me of the days when frontend tooling was iterating, browserify -> grunt -> gulp -> yeoman / parceljs / create-react-app / etc. type of progression. The FAST vision for design systems seems more comparable to the yeoman level approach for building frontend projects. These things really helped accelerate and empower (especially smaller) teams to do bigger things. It also helped the need to spawn many projects rapidly. The trade off with all management and automation systems is control over details in trade for velocity and ease of use. I think this will apply in a similar way to mostly smaller teams who don't necessarily have the resourcing or expertise to build all the details themselves, but want or need a system to fill the resourcing and expertise gap. Whereas, I would expect for larger teams with 1) a single project to build 2) funding to manage the details and 3) strict specifications requiring exact details, it would be more efficient to directly implement the design system. Just as in the case of yeoman, parceljs, or other build system tools, with a large enough team and specific enough requirements there is always the need to "eject" from the tool and manage the system in full detail manually. What are your thoughts on this? |
It's certainly possible to eject or not use the template DSLs at all. No one is prevented from doing that. However, the main point is that for the standard components, the core anatomies are largely the same with only a narrow set of variations per component. There are typically core functional structures that are required, if only to ensure that the accessibility model is correct. So, why rebuild that once it's worked out? Just use the DSL to specify the variation you want and be done with it. Hybrid models are also supported. So, if it works for ten of the components but not the eleventh, you can just build custom for the eleventh. It's another tool in the toolbox for any team looking to be efficient in building out a design system. We've had two years of feedback from partners and customers around this, and paired it with a bunch of performance testing on template variations, so I'm feeling pretty good about forming an API that can handle all the variations and perf optimization scenarios we've seen with plenty of flexibility for things we haven't seen. |
Thanks for the reply. It would be interesting to investigate shared tests for conformance as well. This is one step closer to the DIY end of the spectrum but still allows adherence. I'm thinking something similar to what singel tried to do with the single element pattern. |
Absolutely. So, one of the cool things is that the |
We tend to duplicate patterns from fast-components, like making a direction token for handling ltr-rtl, appearance behavior pattern like mentioned above, dozens of nitty gritty things like styles for button alignment, and even today I was trying to figure out if FAST has a pattern for z-order management which was closed because of the change in direction. Some of these problems are going to need to be solved for any design system built on FAST and (at least speaking for us) we are looking to FAST to find the good patterns for localization, accessibility, and handling issues we expect are common like the z-order management. Having the fast-components as the reference package for components that "do things pretty well" and is worth borrowing ideas from has been useful. It looks like the intention is to do away with that component library from the source tree: #5853. That also intends to remove the component explorer which is a valuable compare point when testing our fast-foundation based components against a "known good" implementation for filing issues.
|
Thanks for the feedback @rajsite - while #5853 does remove those packages, #5849 provides some insight into the "why" and reasoning behind that, as well as how we plan on continuing to provide some of those valuable out of the box implementations. If you haven't yet taken a look, hopefully that can provide some additional insight and background to the intent of 5853. In terms of some of the OOTB patterns and whatnot, @bheston is working on somewhat of a "spec" to detail out plans for starting to abstract out some of the goodness that was previously delivered via fast-components for use in building design systems. While there's an open PR, we feel that a spec will help us scope and plan to scale for what's most urgent, and then what can be followed up with. For instance, we believe that it's vital to get the adaptive color algorithms and recipes abstracted for use a la carte by folks. What is not known, is how much of an implementation should be brought in immediately and what other abstractions might be valuable. Over time, I could see including baseline resets as css partials, such as the base button styles, etc. Part of this also folds into the later stages of this proposal. Our hope with the spec is that it can help us draw clear lines for where those goodies live and what the best approach for abstraction and delivery is for each (IE, does it become a part of foundation, or does foundation take a dependency to provide that, etc...) Wanted to get a quick response over - would love to hear more about what specifically has been valuable and how you've been leveraging so we can use that information to make sure our decisions help meet your needs long term! |
Update: Foundation Iteration 4 is committed to our main branch and released in beta. The CLI does not yet generate components based on this version, but that work is in progress now. |
Aside from that I've just created an issue at the custom elements analyzer project concerning FAST Element compositions. |
Great feedback @sonntag-philipp ! On the documentation/analyzer front, we have plans around that as part of the CLI. We've recently done some work to generate |
Alright, I'm really glad to hear that! |
At present, the plan is to use the CEM analyzer. This is what we're using for our current foundation docs. We hope to have the CLI set this up for any design system projects as well. |
Until there is an issue specifically for tracking the template builder work for iteration 5. This brings up being able to customize shadow parts for some interesting styling scenarios, and likely would fit somewhere in that work in some shape. #6523 |
for iteration 4, the registration APIs that enabled overrides indeed was never used as we override (copy and edit) templates directly. so iteration 5 with breaking down template portions seem very promising. love the idea. back to iteration 4, can you please clarify the export const designSystem = Object.freeze({
prefix: "fluent",
shadowRootMode: "open",
registry: customElements
}); |
In the future the browser will support Scoped Element Registries. For vNext we're working to make sure the APIs are all ready for that when it arrives. So, for this configuration object, it has a |
Thanks. was surprised to see it already baked in to the API |
trying to wrap my head around an issue where design system provider is used by consumers to customize the prefix. the following /**
* @tag qds-button
*/
export class Button extends FoundationButton { } will output to JSON as "tagName": "odui-button",
"customElement": true but then consumers of a library prefixing their provider will no longer get intellisense over their is it a highly rare use-case? |
Spot on! 🥇 This point is something my lean and mean engineering team is facing as potential maintenance burden if we are copying and extending component templates in order to:
This is moreso commentary; I wish I had a solution to offer but I'm not smart enough to write a language yet 😅 |
Update: I'm currently working on tech to get us all the way to Iteration 6 and beyond. I'm taking a bit of a different approach to what is talked about here from an implementation perspective. The new approach is much more powerful and will enable many creative possibilities and collaborations. I've probably got another month or two of work to get it ready for a PR. Thank you for your patience. |
@EisenbergEffect Any more updates on this new approach? This is a real cliffhanger, and I'm a little curious! 😄 |
@ThorFjelldalen I left Microsoft in November of last year. Since then, I haven't been able to contribute much to FAST. The work I was doing back in March was a side project and unfortunately had to be paused as it didn't align with what I needed to do for my current business. |
Ah, I understand. Thanks for the quick answer! |
Okay, so... if EisenbergEffect is gone, what's the status of Fast? Is there any chance of this ambitious project moving forward? Is MS still putting any resources into this project? An update would be appreciated. |
The project is still moving forward. I won't speak fully for @EisenbergEffect, he is still a valued part of the Steering Committee, and we just met together recently (last week). It's still moving forward and different people across Microsoft make up the core maintainers, as well as a few core people outside of MS. The work that has been done on FAST has always been an OSS effort and that continues to be the case as it will into the future. |
Not only does Microsoft help maintain FAST but it is also a user of FAST. To use it, we needed a version of Web Components fully aligned with Fluent 2. Over the last year or so, that is where a lot of our focus has been centered and that effort is nearing completion to the point that we have a large set of Fluent UI Web Components available to use inside Microsoft and by 3rd parties. Once teams have a chance to onboard to these components, focus and investment should shift back toward FAST as teams need features and improvements. |
Might be of interest https://github.com/genesiscommunitysuccess/custom-elements-lsp |
Closing this as Foundation is being deprecated, for details please refer to #6955. |
Last week @chrisdholt shared our vision for the future of FAST Components. In that post, we briefly touched on how FAST Foundation might evolve and play a more prominent role in the future, combined with the introduction of our new command-line interface (CLI). I want to take some time now to expand those ideas, paint a bit of a technical vision for the future, and show you how that might unfold over a series of iterations.
The Big Picture: Design System as Code
Wait. What? Isn't this post supposed to be about FAST Foundation and Design Systems?
Why yes, it is.
The goal for FAST Foundation and what we call "Adaptive UI" has always been to get us to what I'm going to refer to as "Design System as Code". Here's a simple definition inspired by the above.
We believe that DSaC will become a essential DesignOps and UX Engineering practice, used in conjunction with experimentation and continuous delivery.
To provide some light justification for this claim, let's look back at a trend in the broader industry over the last couple of decades. We can see a common pattern that goes something like this (using DevOps and IaC as an example again):
(I should note that step 6 often comes before 4, depending on market opportunity. Eventually, it repeats itself later after standardization occurs, where the original provider deprecates the previous version and ships a new offering or they make significant changes to the existing product to support standards. The reality of the innovation/standardization tug-of-war is always more complex, but hopefully, this still makes its point.)
Ok, before we get too far off track, let me pull this back to design systems. This post isn't intended to analyze the history of software industry trends or DevOps. It's about where we're going with FAST Foundation.
So, let's take the IaC and DevOps sequence from above and look at it in terms of design systems.
Interestingly, the design system industry was stuck in phase 3 for a very, very long time. It is only within the last two years that phases 4 and 5 have begun. This stall was mainly due to Web Components taking about 7 - 8 years of standards work to ship in every browser. That was a huge milestone that unlocked the industry and enabled us to move forward with FAST.
The Past, Present, and Future of FAST Foundation
As it exists today, FAST Foundation was a first attempt at a 2nd generation framework for design systems. We think it's pretty nifty, but we're also keenly aware of its shortcomings and limitations (thank you, the community, for all the amazing engagement and feedback over the last two years!). In the following few sections, we'll look at the previous and current states of FAST Foundation as an initial phase 5 offering, and then I'll walk you step-by-step through the changes we're considering and show you how we're going to unlock the path to phase 6.
Iteration 1 (Past)
The
@microsoft/fast-foundation
library started as a collection of component base classes and templates. We used it to build the first version of the Fluent UI Web Components. As the community came on board, we got a lot of feedback, mainly that things weren't configurable. For example, component names, prefixes, shadow DOM modes, etc. couldn't be changed. So, we built a new set of APIs that led us to...Iteration 2 (Present)
@microsoft/fast-foundation
now consists of component base classes, template factory functions, and various primitives, such as a design token object model and a design system configuration model. It's a good start at building the runtime of a DSaC system, and we used it to build v2 of the Fluent UI Web Components, which are the foundation for various experiences in Edge, Windows 11, and MSN. However, FAST Foundation still has a few problems:Most people don't experience these problems through FAST Foundation but through what we've previously called "FAST Components," which introduced another set of challenges:
Ultimately, this method just isn't working. It's not meeting the community's needs, nor is it giving us the power we need to move forward with v3 of the Fluent UI Web Components. The next set of iterations lays out how we will solve these problems.
Iteration 3 (In Progress)
The next iteration isn't so much a change in
@microsoft/fast-foundation
as it introduces the FAST CLI. The CLI is intended to address several of the biggest problems we've seen the community struggle with:The CLI will provide a command to generate a design system similar to the following.
What we previously shipped as a component library in
@microsoft/fast-components
will now be a set of templates for your design system. The goal is that within a couple of minutes, you should be able to generate a new design system and then immediately be able to run Storybook to see all your Web Components in action. You should also be able to add new Foundation components as needed with a simple command like this:Based on the feedback we've heard from the community, we think this will significantly improve your experience building design systems right out of the gate. Once you no longer fight against a preset package of components like
@microsoft/fast-components
but instead own the design system code directly, working with them becomes much more manageable. You'll be able to look at the styles for each component and see how the tokens are used. If you need to add custom styles, it's no longer a series of arcane overrides. If you need to introduce your design tokens on top of the base tokens, you just create them and use them in the styles you control, following existing patterns you can see. Many things get much easier to use and learn.Iteration 4 (Future)
While Iteration 3 puts a lot more control into your hands and gets you up and running faster, the underlying programming model is still burdened by old APIs that were designed based on needing tons of runtime configuration and overrides. Iteration 4 will remove that code, addressing the following problems:
We'd like to remove the registration APIs that enabled overrides. These are no longer needed now that you control the design system code. We can then move the Web Components back to a normal registration approach. The CLI templates will update in lockstep with this and will still support centralizing various configuration details using standard JavaScript techniques. To illustrate this, let's look at a few code samples.
First, the CLI will create a simple constant to store shared configuration details. This constant will be generated based on the answers provided to CLI prompts when you create a new project.
design-system.ts
The component code will follow standard patterns that give you full control. Let's look at how a button might be defined in your design system project. Here's what the folder layout could look like:
First, the core component class (state, behavior, etc.) doesn't change from today's implementation. The CLI generates a class for you based on the appropriate foundation component base class.
button.ts
Second, the template for your component also doesn't change (see Iteration 5 below for how we'll introduce customization in the future). The CLI generates a
.template.ts
file with a simple export of the foundation template.button.template.ts
The styles are handled in much the same way. The CLI will generate default styles for you to start.
button.styles.ts
The first new part is that we generate a
.definition.ts
file. This file contains all the metadata thatFASTElement
needs to define the component.button.definition.ts
The second new part is that we generate a
define
file that invokes FAST's define API, provided by the definition, against your default registry.define.ts
The above code, which would all be generated by the CLI, provides complete customization of the component base class and styles and centralized configuration for the design system. With this new setup, we can enable these capabilities without the runtime cost of the current FAST Foundation
provideDesignSystem().register()
APIs. You also retain complete control over when/how the platform defines the component. If you want to auto-define components, import thedefine
module wherever you use the component.The CLI can even configure
package.json
entry points for you so that you can have shorter paths.If you want to control the platform more, import the definition and call
define
yourself whenever you want. You'll even be able to leverage the upcoming W3C Scoped Element Registries feature as soon as it's available.Notice how this approach now also introduces the first governance features. By removing the runtime configuration APIs, you can now prevent consumers of your design system from overriding styles, changing tokens, or messing with your templates. You still have full control, but you can now guard against misuse.
Iteration 5 (Future)
Things are starting to come together, but we've still got problems. Iteration 5 seeks to address the following issues:
Up to this point,
@microsoft/fast-foundation
only provides you with pre-constructed templates for each component. That's great for most cases, but a few scenarios aren't possible. Examples include:To address these needs, I'm proposing that in addition to exporting pre-built templates for components, we also export "template builders," which can be used to construct OpenUI-based template variations.
Let's look at an example of using a
ButtonAnatomy
template builder to customize an Open UI-based button template.button.template.ts
These aren't the actual APIs, but hopefully, this serves as an example of what we could enable. We want to make
@microsoft/fast-foundation
into more and more of a toolkit that helps you build design systems following Open UI patterns. This is the first iteration where something that resembles DSaC starts to emerge, with a fully-typed object model for Open UI-based Web Components.Once again, you may be thinking, "Wait. What? Wasn't it a goal to have customization without runtime cost? This seems like it could impact startup time."
On that note...
Let's talk about a parallel effort already in development as part of the FASTElement 2.0 stream of work: FAST Template Pre-compilation.
So, what's the runtime cost of the template builder code and template customizations?
ZERO.
Actually, the costs are less than zero. We have tech we're working on that allows us to run the template builder code...at build time. The result is an entirely pre-compiled template, ready for immediate instantiation. The builder code, FAST's
html
template function, and the full FASTElement template compiler can all be tree shaken away. You are left with precisely what you need to render your component. Nothing more.We'll be talking about this more in the future. I want to let people know that this is being built in a general-purpose way for use with all your FAST-based Web Components and with whatever bundler you want.
Iteration 6 (Future)
There's still one little problem left to address:
Hopefully, you can start to see where we're going with this. The CLI has been generating starter CSS into projects for each component. In Iteration 6, we'll introduce a CSS API for Open UI-based Web Components, similar to the templating API. Additionally, we'll enable the CLI to generate a default CSS configuration using this API. This iteration is the most speculative part of what we're proposing, but you can imagine something like this:
button.styles.ts
Naturally, we'll use our pre-compilation technology to run this at build time so that you have optimized CSS that needs no further processing to render. This process allows us to tree shake the builder and shake out the
css
template helper, CSS directives, and associated runtime code.Beyond FAST Foundation
We have arrived at something we can call "Design System as Code," enabled by design tokens, standard component behaviors, and standard anatomy/presentation object models. However, there's much more we can unlock once we get to this point. It's just the beginning. For example, the builder code shown above has a declarative look. Could a JSON or Yaml language be mapped over the builders? Could tools be created to emit this JSON? There are lots of exciting opportunities.
Wrapping Up
We're not satisfied with the state of design system creation in the industry. We believe we've made solid strides in improving it with what we've got in FAST today. However, we're not there yet. Above I've outlined what I think are the next set of iterations in our foundation technology, which will take FAST and the industry forward. We would love to hear your thoughts.
If you're not sure how to provide feedback, here are a few things we'd love to hear from you about:
The text was updated successfully, but these errors were encountered: