Releases: jails-org/Jails
v6.4.1 - Patch Update
v6.4.0 - Minor Update
Change Log - Breaking Change ⚠️
Removing the helper attr()
added on 6.3.0.
Now, in order to listening to attribute changes, you can use the helper on('change[attributeName]', callback)
instead.
New version ✓
export default function myComponent({ main, on }) {
main(() => {
on('[src]', onChangeSrc)
})
const onChangeSrc = ( key, value ) => {
console.log(`Changed ${key} to ${value}`)
}
}
Old version: ❌
export default function myComponent({ main, attr }) {
const attributes = attr()
main(() => {
attributes.change('src', onChangeSrc)
})
const onChangeSrc = ( key, value ) => {
console.log(`Changed ${key} to ${value}`)
}
}
v6.3.4 - Patch Update
Change Log
- Adding type definitions for the new helpers dataset and attr.
- Updating exports type definitions
v6.3.3 - Patch Update
Change Log
- Renaming html.mjs to html.js to be conform with type definitions.
v6.3.2 - Patch Update
Change Log
Removing global browser references to avoid problems with server-side systems.
v6.3.1 - Patch Update
Change Log
Fix on export template
function. It was not re-running template system transformations.
v6.3.0 - Minor Update
Change Log
Changing attributes
to attr
to be less verbose, and changing onchange
to change
to be more consistent with events names used on DOM.
Also, attributes would colide with jails-js/html
attributes for html on templates, so its better to use different name.
Usage
export default function myComponent({ main, attr }) {
const attributes = attr()
main(() => {
attributes.change('src', onChangeSrc)
})
const onChangeSrc = ( key, value ) => {
console.log(`Changed ${key} to ${value}`)
}
}
v6.2.0 - Minor Update
Change Log
Adding a new functionality that provides a interface to listening to component attribute changes.
Usage
export default function myComponent({ main }) {
const attr = attributes()
main(() => {
attr.onchange('src', onChangeSrc)
})
const onChangeSrc = ( key, value ) => {
console.log(`Changed ${key} to ${value}`)
}
}
v6.1.0 - Minor Update
Change Log
Adding a feature for parsing dataset
of a element. Very usefull when you have to pass an object to configure a component.
E.g
<my-component data-config="{ name: 'my-name', age: 41 }">
<!-- -->
</my-component>
export default function myComponent({ main, dataset }){
const { name, age } = dataset('config')
main(() => {
console.log({ name, age })
})
}
v6.0.6 - Patch Update
Change Log
The view() function has been updated to return the state by default, ensuring consistent behavior even when the user omits an explicit return.
Old
export const view = () => {
const newdata = 'something'
return { ...state, newdata }
}
New
export const view = () => {
const newdata = 'something'
return { newdata } // All state data will be available, plus new data.
}