Code Monkey home page Code Monkey logo

doz's Introduction







Almost like writing in VanillaJS. For modern browser.



Documentation | API | Demo | Browse example code

๐Ÿ‘‰ SEE A PROJECT BUILT WITH DOZ ๐Ÿ‘ˆ


Look at the code on Codepen

Why

  • ๐ŸŽผ Works with tagged template literals
  • ๐ŸŽณ Component based
  • ๐Ÿงฉ WebComponent ready
  • ๐Ÿช Global stores
  • ๐Ÿ˜† Global components
  • ๐Ÿ”ซ Fast performance
  • ๐Ÿ’… Scoped style
  • ๐Ÿ“ก Uses ES6 proxy to observe changes
  • ๐Ÿ˜ Simple and familiar API
  • ๐Ÿ˜ฑโ€ No extra syntax like JSX
  • ๐Ÿ’ฃ No confusion with props and state
  • โ› Extensible through: plugins, mixin, components
  • ๐Ÿ“ฝ CSS animation support

Get started

$ npx doz-cli app my-app
$ cd my-app
$ npm start

Example

<div id="app"></div>

Component definition

ButtonCounter.js

import {Component} from 'doz'

export default class ButtonCounter extends Component {
    
    constructor(o) {
        super(o);
        this.props = {
            counter: 0
        };
    }

    template(h) {
        return h`
            <style>
                button {
                    font-size: 16px;
                    padding: 20px;
                }
            </style>

            <button onclick="${this.increase}">
                count ${this.props.counter}
            </button>
        `
    }
    
    increase() {
        this.props.counter++;
    }

};

Make an app with the component defined above

app.js

import {appCreate} from 'doz'
import ButtonCounter from './ButtonCounter'

appCreate('#app', ButtonCounter);

Doz ecosystem

  • ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป doz-cli provides a boilerplate to creating app and component
  • ๐Ÿ‘จ๐Ÿผโ€๐ŸŽจ doz-ssr server side rendering
  • ๐Ÿคณ๐Ÿผ doz-snap transforms app to static HTML
  • ๐Ÿ‘ฉ๐Ÿผโ€๐Ÿš€ doz-router a complete component for routing
  • โœ๐Ÿผ doz-metatag a plugin for managing basic OG meta tag in your app (perfect with doz-ssr)

CDN unpkg

<script type="module">
    import {Component} from 'https://unpkg.com/doz/dist/doz.min.js'
    //...
</script>

Changelog

You can view the changelog here

License

Doz is open-sourced software licensed under the MIT license

Author

Fabio Ricali

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.