Nano JSX

SSR first, lightweight 1kB JSX library.

README

Nano JSX Logo


SSR first, lightweight 1kB JSX library.



Written in TypeScript.
Works on Node and Deno.
  Designed to build ultra fast MPAs and SPAs.




Getting Started


- Visit the website
- Download the template
- Check out the sandbox
- Try the deno example

Video Tutorial



Features


The best about Nano JSX is the small bundle size. It builds, although is sound crazy, bundles as small as svelte!

More Features


- SSR  
  Out of the box, very simple to use

- Pre-Rendering  
  Renders your app to static html if you want.  
  (This is possible, but requires some knowledge.  
  I plan to make a tutorial soon.)

- Partial Hydration  
  Hydrate and only the parts you really need

- Isomorphic Router  
  Works on Client- and Server-Side

- CSS in JS  
  Use JavaScript objects for styling

- No JSX build tools required  
  Uses Tagged Templates instead of JSX if you prefer

- Props, Ref, Context and Events  
  Use Props, Ref, Context API and Events as you are used to in react

- Inline SVG  
  No problem

- Prefetch  
  Use the built-in Link Component

- 1KB (gzip)  
  All of this in only ~1KB  
  _(Well, the core module is only about ~1KB)_

- CustomElements mode  
  You can define your component written with Nano JSX as web-components with defineAsCustomElements. This enables you to develop very light web components. (thanks @Shinyaigeek)

Documentation


Checkout the website to find out more!


Development Section


Run browser tests (visually)


  1. ```bash
  2. # install dependencies
  3. npm install

  4. # build
  5. npm run build

  6. # bundle
  7. npm run bundle

  8. # create instrumented bundle
  9. npx webpack -c webpack/webpack.bundle.instrumented.js

  10. # transpile browserTest library
  11. npx tsc -p scripts/browserTest/tsconfig.json

  12. # open browser to run the tests
  13. npx five-server . --open=test/browser
  14. ```