king-partials-components v0.0.8
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.
Getting Started
To building a new partials web components using Stencil, clone this repo to a new directory:
git clone git@gitlab-administrativo.kinghost.net:DevCanais/king-partials-components.git
cd king-partials-components
and run:
npm install
npm start
To build the component for production, run:
npm run build
npm publish
To run the unit tests for the components, run:
npm test
Need help? Check out Stencil docs here.
Naming Components
When creating new component tags, we recommend using k
prefix in the component name (ex: <k-datepicker>
).
Using this component
The king-partials-components are publish to NPM as @cyberweb/king-partials-components. To install you need to have an access token.
Node Modules
- Run
npm install @cyberweb/king-partials-components --save
- Put this script tag
<script type='module' src='/node_modules/@cyberweb/king-partials-components/dist/king-partials-components/king-partials-components.esm.js'></script>
in the head of your index.html - Then you can use the element anywhere in your template, JSX, html etc