Releases: sc0ttj/component
Releases · sc0ttj/component
Released v1.3.0
- new optional add-ons:
html
JSX-like HTML templating, returns templates as a Stringhtmel
JSX-like HTML templating, returns templates as HTMLObject (browser) or String (Node)storage
- persistent state between page refreshes (browser) or script invocations (Node)devtools
- easier debugging of your components (browser only)
- updates to
src/component.js
:- fixed: in NodeJS, debounced logging now falls back to using setTimeout, if needed
- added: support for all new add-ons
- added: allow view to be HTML Object, not only String
- added:
App.actionsList
property - the list of defined actions functions - added:
App()
will return the container (an HTML Element)App({...})
still returnsApp
(for chainable actions, etc)
- added:
App.html
property - alias ofApp.container
(returns an HTML Element)
- update docs:
- re-write README and examples to show re-usable components
- add the new add-ons to README and examples
- updated build configs
v1.1.12
v1.1.11 Released
- updated
rollup
deps and rebuilt files indist/
v1.1.10 Released
- adds debouncing to
render()
function for improved DOM rendering performance
v1.1.9 Released
- New feature: middleware
- allows for customisation of a components setState/render behaviour:
- define an array of functions as
myComponent.middleware = [ someFunc, otherFunc ]
- each function will be run at the end of
setState()
- define an array of functions as
- allows for customisation of a components setState/render behaviour:
v.1.1.8 Released
- fix in package.json: the "main" field should
dist/index.js
v1.1.7 Released
- new feature: event emitter
- if emitter is installed, component "actions" will emit an event
- other components can listen to it with
myComponent.on('actionName', (props) => { ... })
- props will contain the latest state of the component that emitted the event
- other components can listen to it with
- if emitter is installed, component "actions" will emit an event
- added src/emitter.js, implemented as an optional, extra module
- updated build process to also build dist/emitter.min.js
- added examples and updated README
- added examples/usage-emitter.js
v1.1.6 Released
- added a
tweenState
module:- can be imported and added to
Component
as a method - lets you tween from one state to another:
- sets state on every frame of animation, or only the frames you define
- includes many easing functions, see
src/easings.js
- provides useful callbacks for the tween (
onStart
,onUpdate
,onComplete
, etc)
- can be imported and added to
- works in browsers, and in Node 10 and above
- added
rollup
and a build process (usenpm run build
) - updated Travis CI to test build on Node versions 10, 11 and 12
- updated installation instructions
- updated README
v1.1.5 Released
- fixed: scoped CSS sometimes not applied on page load:
- here is the new implementation:
- prefix component CSS with the containers existing
id
orclass
, if any - fall back to previous behaviour only if container has no
id
orclass
:- add unique class to container
- prefix component CSS with that same unique class
- prefix component CSS with the containers existing
- here is the new implementation:
- better performance:
- when
debug
is true, don't console log state history on state change - to see the state history, access
App.log
yourself instead
- when
- see examples/usage-in-browser.html
- updated README
v1.1.4 Released
- new: automatic "scoping" of component CSS
- prevents component styles affecting other parts of page
- simplifies writing CSS for your components:
- removes the need to define unique namespaces (IDs, classes) in your component CSS
- you can disable automatic CSS scoping like so:
App.scopedCss = false
- see
examples/usage-in-browser.html
- adds only ~300 bytes to minified bundle
- README and example updates