Libraries for building UI have become all the rage. React, Vue, Stencil, LitElement, Svelte... the list goes on. Enabling developers to build UI easily and efficiently is a chief concern in the front end world, and the ecosystem is filled with options.
But what goes into a UI library? What defines the core features and capabilities of a UI library?
At the same token, what ISN'T the concern of a UI library? What are the "out of scope" features that other tools should handle?
Library Concerns:
- Returns View Code: Writing a template that later becomes native to the platform. E.g., string template -> HTML.
- Web Components: Ingests CSS: This is the opposite of the above - the library should intake CSS (only CSS, and not Sass or Less) for styling.
- State: Internal state that informs the resulting UI
- Composable: Connecting pieces (or components) together to form a larger interface or application-like experience.
External Concerns:
- Rendering & DOM Insertion: There are a lot of ways to write view code, in addition to many templating languages.
- Bundling: A UI library has no opinion on how the code looks or is compiled, just that the API is valid and the code runs in the environment (browser, native app, etc).