All Projects → dyo → Dyo

dyo / Dyo

Licence: mit
Dyo is a JavaScript library for building user interfaces.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Dyo

Amplesdk
Ample SDK - JavaScript UI Framework
Stars: ✭ 169 (-81.71%)
Mutual labels:  framework, virtual-dom
Apprun
AppRun is a JavaScript library for developing high-performance and reliable web applications using the elm inspired architecture, events and components.
Stars: ✭ 1,087 (+17.64%)
Mutual labels:  framework, virtual-dom
Ioing
Implement the solutions of performance improvement and componentization for your SPA (single page application) products with this Progressive Web App Development Engine.
Stars: ✭ 224 (-75.76%)
Mutual labels:  framework, virtual-dom
Neo
Create blazing fast multithreaded Web Apps
Stars: ✭ 1,219 (+31.93%)
Mutual labels:  framework, virtual-dom
Mithril.js
A JavaScript Framework for Building Brilliant Applications
Stars: ✭ 13,062 (+1313.64%)
Mutual labels:  framework, virtual-dom
Hydux
A light-weight type-safe Elm-like alternative for Redux ecosystem, inspired by hyperapp and Elmish
Stars: ✭ 216 (-76.62%)
Mutual labels:  framework, virtual-dom
Korolev
Single Page Applications running on the server side.
Stars: ✭ 510 (-44.81%)
Mutual labels:  framework, virtual-dom
Aruba
Test command-line applications with Cucumber-Ruby, RSpec or Minitest. The most up to date documentation can be found on Cucumber.Pro (https://app.cucumber.pro/projects/aruba)
Stars: ✭ 900 (-2.6%)
Mutual labels:  framework
Frankie
A frankenstein framework - middleware and annotation based
Stars: ✭ 19 (-97.94%)
Mutual labels:  framework
Centrifuge
Cross-platform runtime mod loader and API for any Unity-based game. Supports Unity 5 and up!
Stars: ✭ 18 (-98.05%)
Mutual labels:  framework
Gantry5
🚀 Next Generation Template / Theme Framework
Stars: ✭ 895 (-3.14%)
Mutual labels:  framework
Helma
Helma web framework
Stars: ✭ 18 (-98.05%)
Mutual labels:  framework
Gdx Ai
Artificial Intelligence framework for games based on libGDX or not. Features: Steering Behaviors, Formation Motion, Pathfinding, Behavior Trees and Finite State Machines
Stars: ✭ 907 (-1.84%)
Mutual labels:  framework
Lying
PHP Framework.
Stars: ✭ 18 (-98.05%)
Mutual labels:  framework
Dna
Progressive Web Components.
Stars: ✭ 22 (-97.62%)
Mutual labels:  virtual-dom
Ulnoiot Upy
retired version of ulnoiot based on micropython
Stars: ✭ 17 (-98.16%)
Mutual labels:  framework
Webcpp
用C++开发web服务器框架
Stars: ✭ 23 (-97.51%)
Mutual labels:  framework
Theoremjs
A Math library for computation in JavaScript 📕
Stars: ✭ 917 (-0.76%)
Mutual labels:  framework
Gaintime
GainTime é um framework de HTML, CSS e JS para desenvolvimento de projetos responsivos, focado na simplicidade.
Stars: ✭ 19 (-97.94%)
Mutual labels:  framework
Framework
High-Performance Long-Living PHP Framework for modern enterprise application development
Stars: ✭ 895 (-3.14%)
Mutual labels:  framework

Dyo

Dyo

A JavaScript library for building user interfaces.

Coverage Size Licence NPM

Installation

  • Use a Direct Download: <script src=dyo.js></script>
  • Use a CDN: <script src=unpkg.com/dyo></script>
  • Use NPM: npm install dyo --save

Documentation

Documentation can be find on the website.

See the Getting Started page for a quick overview.

The documentation is divided into several sections:

You can improve it by sending pull requests to this repository.

Examples

Several examples can be found on the website. Here's one to get started:

import {h, render} from 'dyo'

function Example (props) {
	return h('h1', {}, 'Hello ', props.name)
}

render(h(Example, {name: 'World'}), 'body')

This will render a heading element with the text content "Hello World" into the specified target(the body element).

Comparison

The library is much alike React, so it's only natural that a comparison of the differences is in order; Which if successful might manage to highlight why it exists.

Re-parenting

The Portal component supports string selectors as targets. This presents an array of different possibilities with regards to isomorphic target references.

function Example (props) {
	return h(Portal, {target: 'main'}, 'Hello')
}

render(h(Example), 'body')

In addition to this – re-parenting is baked into portals. That is when a portals container is changed, instead of unmounting its contents and re-mounting them to the newly designated container we can instead move its contents without replaying destruction unmount operations that may discard valuable interface and component state.

In co-ordination with custom renderers, portals afford the opportunity to create atomic branch specific custom renderers. Imagine isolated declarative canvas renderers within a document renderer.

Promises

Promises(or thenables) are first class values. This affords authors the ability to render promises, directly await promises within effects and events, and delay unmounting.

render(props => Promise.resolve('Hello'), 'body')

function Example (props) {
	useEffect(async () => {
		// out of band updates in here
		// are also batched
		return async () => {
			// delays unmount until the animation
			// has completed
			return props.current.animate({}).finished
		}
	})
}

Callbacks

In an async world, public interfaces like render are not guaranteed to complete synchronously if a subtree happens to have async dependencies within it. A consequence of this will see more use cases for the optional callback arguments that this function accepts – in much the same way authors are afforded the ability to await on this central routine.

await render(props => Promise.resolve('Hello'), 'body')
Resources

In addition to other hooks, a resource allocation hook that can be used to fetch and cache resources.

function Example (props) {
	const resource = useResource(props => fetch('https://reqres.in/api/users'))
	return h('pre', {}, JSON.stringify(resource))
}
Async Server Rendering

Server side rendering supports the plethora of async primitives supported.

import {http} from 'http'
import {h, render, useResource} from 'dyo'

function Example (props) {
	const resource = useResource(props => fetch('https://reqres.in/api/users'))
	return h('pre', {}, JSON.stringify(resource))
}

http.createServer((request, response) => {
	return render(h('html', {}, h(Example)), response)
}).listen(8080)

License

Dyo is MIT licensed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].