Skip to content
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

Why is provideVSCodeDesignSystem() necessary? #542

Open
justinfagnani opened this issue Feb 22, 2024 · 2 comments
Open

Why is provideVSCodeDesignSystem() necessary? #542

justinfagnani opened this issue Feb 22, 2024 · 2 comments
Labels
enhancement New feature or request vnext A change that will be shipped in the next major release.

Comments

@justinfagnani
Copy link

Feature request

Provide easier to use component definitions, either self-registering modules or modules that export a custom element class to register.

Expected behavior

Elements are easier to use.

Current behavior

Elements require an unusual boilerplate to start using:

This is the first time I've used anything based on Fast, but I couldn't get any elements to render at first, then noticed this in the docs:

import { provideVSCodeDesignSystem, vsCodeButton } from "@vscode/webview-ui-toolkit";

provideVSCodeDesignSystem().register(vsCodeButton());

As a user this seems like uneccessary boilerplate. Why can't I just import the library and use the components? Like:

import "@vscode/webview-ui-toolkit";

This is how most web components that I use behave.

@justinfagnani justinfagnani added the enhancement New feature or request label Feb 22, 2024
@hawkticehurst
Copy link
Member

Hey @justinfagnani!

I completely agree. This API/syntax is an artifact of how the current version of FAST works. The next major release of FAST should have an import syntax that looks closer to what you suggested.

cc @chrisdholt for further details about what the future API will look like and current timelines on the release date

@hawkticehurst hawkticehurst added the vnext A change that will be shipped in the next major release. label Feb 23, 2024
@chrisdholt
Copy link
Member

Hey @justinfagnani!

I completely agree. This API/syntax is an artifact of how the current version of FAST works. The next major release of FAST should have an import syntax that looks closer to what you suggested.

cc @chrisdholt for further details about what the future API will look like and current timelines on the release date

Future syntax is just that - the other was an artifact of a different era for "reasons". @hawkticehurst I'll reach out offline as I owe you actual code pertaining to this. With @justinfagnani's ask, I'll prioritize it best I can :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vnext A change that will be shipped in the next major release.
Projects
None yet
Development

No branches or pull requests

3 participants