Installation
Note: The APIs described in this document may be inconsistent with the version. Please refer to the installed type files.
Gyron.js
is a lightweight reactive framework, similar to Vue and React. Based on the mature community environment, it integrates a routing manager and state manager adapted to Gyron.js
.
Gyron.js
provides SSR support. This document is developed with the SSR capability of Gyron.js
.
Installation Methods
Different installation methods can be used for different scenarios to better fit our project.
- Reference using CDN.
- Quickly generate templates using CLI.
- Reference using npm.
- Use after download. Reference
CDN
There are some free CDN service providers in the community. Here are some commonly used ones.
NPM
This way of referencing is recommended. It can easily use community resources and support more different browser versions.
npm install gyron -D
Use After Download
Although you can download and then use our framework, it is not recommended, because some bugs may not get fixed in time.
After downloading through the CDN service, save it as gyron.js, then import it via the script tag.
<div id="root"></div>
<script type="module">
import { createInstance, h } from './gyron.js'
createInstance(h('button', 'Like')).render('#root')
</script>
Version
The latest version in public npm is
File | Module | Note |
---|---|---|
dist/esm/index.js | ESModule | Recommended if using bundlers |
dist/cjs/index.js | CommonJS | Suitable for server-side rendering |
dist/browser/index.js | ESModule | This version does not contain environment related information and can be used directly in the browser |