GithubHelp home page GithubHelp logo

lazarusua / owl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from odoo/owl

0.0 0.0 0.0 19.99 MB

OWL: A web framework for structured, dynamic and maintainable applications

Home Page: https://odoo.github.io/owl/

License: Other

JavaScript 11.93% TypeScript 87.39% Python 0.11% HTML 0.06% CSS 0.51%

owl's Introduction

๐Ÿฆ‰ Owl Framework ๐Ÿฆ‰

License: LGPL v3 npm version Downloads

Class based components with hooks, reactive state and concurrent mode

Try it online! you can experiment with the Owl framework in an online playground.

Project Overview

The Odoo Web Library (Owl) is a smallish (~<20kb gzipped) UI framework built by Odoo for its products. Owl is a modern framework, written in Typescript, taking the best ideas from React and Vue in a simple and consistent way. Owl's main features are:

  • a declarative component system,
  • a fine grained reactivity system similar to Vue,
  • hooks
  • fragments
  • asynchronous rendering

Owl components are defined with ES6 classes and xml templates, uses an underlying virtual DOM, integrates beautifully with hooks, and the rendering is asynchronous.

Quick links:

Example

Here is a short example to illustrate interactive components:

const { Component, useState, mount, xml } = owl;

class Counter extends Component {
  static template = xml`
    <button t-on-click="() => state.value = state.value + props.increment">
      Click Me! [<t t-esc="state.value"/>]
    </button>`;

  state = useState({ value: 0 });
}

class Root extends Component {
  static template = xml`
    <span>Hello Owl</span>
    <Counter increment="2"/>`;

  static components = { Counter };
}

mount(Root, document.body);

Note that the counter component is made reactive with the useState hook. Also, all examples here uses the xml helper to define inline templates. But this is not mandatory, many applications will load templates separately.

More interesting examples can be found on the playground application.

Documentation

Learning Owl

Are you new to Owl? This is the place to start!

Reference

Other Topics

Installing Owl

Owl is available on npm and can be installed with the following command:

npm install @odoo/owl

If you want to use a simple <script> tag, the last release can be downloaded here:

Installing Owl devtools

The Owl devtools browser extension is also available in the release: Unzip the owl-devtools.zip file and follow the instructions depending on your browser:

Chrome

Go to your chrome extensions admin panel, activate developer mode and click on Load unpacked. Select the devtools-chrome folder and that's it, your extension is active! There is a convenient refresh button on the extension card (still on the same admin page) to update your code. Do note that if you got some problems, you may need to completly remove and reload the extension to completly refresh the extension.

Firefox

Go to the address about:debugging#/runtime/this-firefox and click on Load temporary Add-on.... Select any file in the devtools-firefox folder and that's it, your extension is active! Here, you can use the reload button to refresh the extension.

Note that you may have to open another window or reload your tab to see the extension working. Also note that the extension will only be active on pages that have a sufficient version of owl.

owl's People

Contributors

ged-odoo avatar sdegueldre avatar aab-odoo avatar kebeclibre avatar juliusc2066 avatar brboi avatar polymorphe57 avatar alexkuhn avatar simongenin avatar seb-odoo avatar mcm-odoo avatar caburj avatar lucaslefevre avatar vincentschippefilt avatar pparidans avatar cammarosano avatar jpp-odoo avatar fdardenne avatar bastienfafchamps avatar tsm-odoo avatar devoidfury avatar poma-odoo avatar myearn4 avatar glovebx avatar dependabot[bot] avatar xmo-odoo avatar vva-odoo avatar stmugisha avatar rrahir avatar dupski avatar

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.