DEV Community

Tobi
Tobi

Posted on

What's New In DativeJs

dativejs logo

What's New in DativeJs

DativeJs has released a new version recently v2-alpha.1

What does it bring

DativeJs has added new feautures like

  • animations
  • helpers

Some global methods has been deprecated like

  • Dative.importstyle(href: string) use the normal <link> now
  • Dative.use(plugin, ...opts) use app.use

Some options has been deprecated,changed

  • update has been deprecated
  • mounted has been changed to onmounted
  • created has been changed to oncreated

New Options has added

  • animate for defining animations
  • use for installing a plugin
  • property for creating a local property
  • attach for attaching a Dative Component/Instance to another Dative Instance

New Global Methods added

  • defineApp This is a shorter way of creating a dative instance. No Need For new keyword with the defineApp methods
import { defineApp } from 'dativejs'


var app = defineApp({
   el: "#app" // or a css selector or a tag 
})
Enter fullscreen mode Exit fullscreen mode
import { defineProperty } from 'dativejs'


defineProperty('foo',()=>{
  return 'bar' 
})
Enter fullscreen mode Exit fullscreen mode
import Dative from 'dativejs'


export let SideBar = Dative.extend({
   // same options with the dative option but no el options
})

// index.js

import { SideBar } from './sidebar.dative.js'


new SideBar({
   el: "#sidebar"
})
Enter fullscreen mode Exit fullscreen mode

The new way of installing a plugin in Dative.Js is quiet more easy

See Plugin In DativeJs Docs

See Migration Path

Top comments (0)