v2.0.3

Getting Started

Last updated


What RenderJS needs and the two ways to install it (npm or CDN).

Prerequisites


  • A modern browser with ES2022 support (IntersectionObserver, navigator.clipboard, fetch)
  • Node.js (build/development only; no Node runtime dependency at execution time)
  • No other runtime dependencies

Installation


Install via npm


  1. npm i @pardnchiu/renderjs

Include via CDN


  1. <!-- Version 2.0.0 and above -->
  2. <script src="https://cdn.jsdelivr.net/npm/@pardnchiu/renderjs@[VERSION]/dist/RenderJS.js" copyright="Pardn Ltd"></script>
  3. <!-- Version 1.x (formerly PDRenderKit) -->
  4. <script src="https://cdn.jsdelivr.net/npm/pdrenderkit@[VERSION]/dist/PDRenderKit.js"></script>

The RJS template engine requires copyright="Pardn Ltd": without it the script tag removes itself and never sets the init flag (document.$init), so RJS only processes text on the root node and leaves every child directive and {{ }} unrendered. Prototype extensions and chainable DOM construction work either way.

Next Steps


中文