/spark

Primary LanguageTypeScriptGNU General Public License v3.0GPL-3.0

@chronocide/spark

@chronocide/spark is a simple JSX templating language.

License GPLv3 NPM Bundle size

Getting Started

Installation

npm i @chronocide/spark

Example

Using @chronocide/spark should feel familiar for those used to writing JSX:

tsconfig.json

{
  ...
  "jsx": "react",
  "jsxFactory": "spark.createElement",
  "jsxFragmentFactory": "spark.Fragment"
  ...
}

index.tsx

const Template = props => (
  <html lang="en">
    <body>{props.children}</body>
  </html>
);

const Page = () => (
  <Template>
    <h1>Title</h1>
  </Template>
)