Skip to content
This repository has been archived by the owner on Apr 16, 2023. It is now read-only.

loganvolkers/template-demo

Repository files navigation

Built With Stencil

Template Demo

This is a proof of concept for building templated dynamic components using Stencil and <template> tags. It is inspired by React context and Stencil Context.

HTML all the way down

The whole is inspired by Vue. The goal is to create templates that can render dynamically but are valid HTML.

JSX, Handlebars, Mustache, Jinja, Liquid, ICU (ReactIntl, Vue I18n), JSONata, and other languages for dynamically accessing data and building components and strings are fantastic technologies, but they fail the web component test. They are not valid HTML.

Why use templates based on valid HTML?

  • Tooling is easier
    • WYSIWYG Editors (e.g. TinyMCE, GrapesJS, etc.)
    • Testing (e.g. JSDom )
    • Translation tools (e.g. Transifex)
    • Linting and validation
  • Everyone already knows HTML
  • Simple toolchain
    • Just Stencil.js, can be rendered anywhere. No need for multiple layers. No need for pre-compilation.

Why <template> tags?

Getting Started

To run this example clone this repo and run:

npm install
npm start

To build the component for production, run:

npm run build

To run the unit tests for the components, run:

npm test

Need help? Check out our the Stencil Documentation.

Using this component

These components have not been published, and cannot be used outside of cloning this repository.

About Stencil

Stencil is a compiler for building fast web apps using Web Components.

Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec.

Stencil components are just Web Components, so they work in any major framework or with no framework at all.

About

Stencil.js demo using dynamic templates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published