Giter VIP home page Giter VIP logo

dragon's Introduction

Dragon

Hypothesis: What if Backbone were created today, with ES 6&7, Virtual DOM, etc?

Hypothesis of project

What if Backbone were to be created today? What would the project look like? With ECMAScript 6 & 7, HTML5 pushState, Virtual DOM / Incremental DOM / etc., new ways of data-binding, etc., front-end development has evolved. This project sets out to see what such an evolution would look like from scratch.

Change log

See the change log.

Changes from Backbone to Dragon

General Changes

  • ES6 classes and ES7 class properties.
  • No more .extend() for extending a View, Model, etc. Instead, ES6 class and extends are used.
  • super() is used, and is expected to be used by developers to call parent methods.

Collections

  • Collections use the base Model by default instead of whining about not having a Model

Mixins

  • No more .extend() for mixing. Just use Object.assign directly.

Models

  • No more .set() and .get(); instead, just use the model's attr directly, as 'Object.observe' is observing changes.
  • No more .has(); just check for the property existence directly
  • No more .unset(); just delete it directly.
  • .toJSON actually returns JSON
  • Currently previous/changed properties/methods are not implemented as they can be found in the changes array. Open to re-implementation.

Views

  • Use Incremental DOM for quick patching of DOM changes. This makes a wrapping tag required.
  • Templates now managed by Starplates

Router

The router is inspired from Chaplin.

  • Objects in router can now be disposed, which has always been a bane for Backbone's router.

Controllers

The controller is inspired from Chaplin.

  • Controllers have been added to provide MVC structure with the router.

Dispatcher

The dispatcher is inspired from Chaplin.

  • Responsible for instantiating controller & action on matching route.

TODO

Mixin Ideas

Models

  • Delete/Unset that doesn't use delete
  • LocalStorage
  • Pagination
  • Schemas
  • Undo/Redo
  • Validation

Views

  • Collection View
  • Composition
  • Infinite Scroll
  • Media Queries
  • Regions
  • Selector Store (cache reference to selector in view template)
  • Transitions
    • afterEnter
    • beforeEnter
    • beforeEnter('someOtherView')
  • View States (beforeRender, afterRender, etc..)
  • Visibility (would mainly be useful with media query states)

Other

  • Redux integration

dragon's People

Contributors

chrisabrams avatar alejandrojsr7 avatar stevekinney avatar victorwpbastos avatar

Stargazers

 avatar Bartosz Cytrowski avatar  avatar Andre Asselin avatar Alexander Khlebnikov avatar Greg Sabia Tucker avatar Damian Mullins avatar Tomohiro Hashidate avatar Fred Ghilini avatar Nicholas Valbusa avatar  avatar Robert Hoffmann avatar PadagOne avatar Tom Chapman avatar Eirik L. Vullum avatar Rene Kriest avatar Stephen Lang avatar Yusuf Yalım avatar Quang Van avatar Yuri avatar alwayrun avatar Rocky Wu avatar Ianko Leite avatar André Moraes avatar Matías Manuel Méndez avatar Joshua Wilson avatar MO avatar Sanchez Eric avatar The Dude avatar  avatar  avatar MichaelPfuetze avatar Gabriel Corado avatar xwartz avatar Talysson de Oliveira Cassiano avatar Chris  avatar m4dz avatar Daniel Blendea avatar haoran avatar dengdeng avatar kazuya kawaguchi avatar Keisuke KITA avatar welkang avatar exex zian avatar Xiaofan Hu avatar Young avatar Zhao Lei avatar Nicolás Sanguinetti avatar Stanley Jones avatar Elric avatar  avatar zhangjx avatar Binliu avatar Arcticfox avatar Mundi Morgado avatar Kensuke Nagae avatar Jacobo Tabernero avatar limichange avatar Nigel Sirisomphone avatar Béla Varga avatar Ryan Martin avatar MM2 avatar Sean Goresht avatar wyqydsyq avatar Dmytro Piddubnyi avatar Patrick Reynolds avatar Tim Wisniewski avatar Adrian Lynch avatar Esteban Lussich avatar Florent DUVEAU avatar David Hidalgo avatar Luiz Gonzaga dos Santos Filho avatar Artem Shubovych avatar Yuan Zhu avatar  avatar Timophey Molchanov avatar Anton Orlov avatar Trae avatar Francisco Cortés avatar Ilya Radchenko avatar Julian avatar Vladislav Bezenson avatar Steve Hill avatar Sérgio Santos avatar Vasu avatar Vladislav Botvin avatar Marcos Piazzolla avatar Vladimir Stolyarov avatar Igor Zimensky avatar Artem Malko avatar  avatar Cory Armbrecht avatar Gerardo Lisboa avatar Sean Powell avatar  avatar Sergey avatar J. Felix Etcetera avatar Carter Chen avatar Andrey Buligin avatar Patryk Orwat avatar

Watchers

Konstantin Kitmanov avatar m4dz avatar Philippe Charrière avatar  avatar alwayrun avatar Mike Fielden avatar James Cloos avatar Juan Ramirez  avatar Tarun M avatar Julien Noel avatar  avatar Pascal avatar

dragon's Issues

Integrating with diffhtml instead of virtual-dom

I've been experimenting with a project called diffhtml that provides an interface to DOM diff and patch view changes (very much like virtual-dom). Right now it's far from being production ready, but is more feature-rich than virtual-dom and IMO a much more elegant interface. For instance, virtual-dom did not support data attributes the last time I used it (not sure if this has been fixed since), is quite large, and requires converting HTML to hyperscript in order to actually diff (I see you're using html-to-vdom in the view layer). virtual-dom also does not attempt to polyfill Custom Elements or provide a transitions API.

You can investigate the GitHub page to see more details, or check out this demo repository to see some interesting usage of the transitions API and Custom Elements.

I'd love to help prototype a build that includes this, only because I find the interface is much more practical and elegant than virtual-dom's. I'm still actively working on diffhtml, so if you decide to give it a go, ping me and I'd be happy to help contribute in any way.

How Serious is This Project?

As a longtime Backbone-user who is looking for more modern features like ES6 and virtual DOM support, I love the concept of Dragon. And since I'm starting a new project soon, I'm seriously considering using Dragon for it.

However, I'm a bit concerned about the long-term future of the project. In other words, I'm wondering: is this just a side project that you might lose interest in in six months? Or is it a key part of a real world application you maintain professionally? Are you committed to evangelizing and supporting Dragon in the future, or is this more of a "here's something cool, feel free to use it, but you're on your own if you do"?

Basically any information you could provide on Dragon's future would be helpful for someone like myself who is considering adopting it. Thanks.

WebSQL is gone too

http://www.w3.org/TR/webdatabase/

WebSQL has been dropped by W3C a few years ago. IndexedDB is often used in replacement but it may be overkill for this project. Better use localStorage and Service Workers for persistant data storage.

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.