Skip to content

nesterow/frontless-riot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

frontless-riot

Riot.JS build with dependency injection for globals like document or Node. Main purpose is to avoid concurent access to global variables when rendering components on the server side inside async functions or promises.

References

Cases when concurrent access happens on backend:

  1. Concurrency in Node.JS
  2. Async/Await Hell

For frontend guys : Wait don't touch that

Usage

  npm i @frontless/riot
import * as riot from '@frontless/riot'
import {JSDOM} from 'jsdom'
import MyTag from 'mytag.riot'

riot.register('mytag', MyTag)

async render(){
  const {document, Node} = new JSDOM().window;
  const root1 = document.createElement('div')
  document.body.appendChild(root1)
  const result = riot.di({document, Node}).mount(root1, {}, 'random')
}

About

Riot.JS with dependency injection

Resources

Stars

Watchers

Forks

Packages

No packages published