- Support new Node v13 esm export/import.
- Default to
:root
element when target is omitted from portal/ render container. - Add optional dependencies array argument for
useResource
hook. - Support portal props, for example h(Portal, {class: 'home'})
- Support string ref callbacks, for example
h('video', {ref: pause ? 'pause' : 'play'})
- Better align the default dependencies for
useMemo
anduseCallback
. - Merge
/server
into main package (breaking). - Remove async generators (breaking).
- Change package name "dio.js" to "dyo".
- Move repo to organization. github.com/dyo/dyo
-
Suspense
,Boundary
,Context
andPortal
components. -
memo
andlazy
factories. -
Added hooks(state, effects, context, ref and memo/callback hooks).
-
Portal re-parenting.
When a portals container changes, previous children are moved to the new container instead of unmounted and re-created.
-
The
render
interface can now render into any container. For example it could noop render into a non-document container:render('Hello', {})
. -
New
dyo/server
package, supports rendering to any writable streams For example – a node response object:render('Hello', response)
, with friction-less async and error boundary support.
- Removed
unmountComponentAtNode
.
Redundent given render(null, target)
archives the same effect.
- Removed
findDOMNode
.
Undeterministic given exotic elements like Fragments don't have "single" DOM node. Refs are the better abstraction given they are also auto-fowarded.
- Removed
renderToStream
andrenderToString
.
Better level of abstraction with a single source of entry with: render
. The dyo/server
package accepts writable streams to write to.
- Removed
componentWillMount
,componentWillUpdate
andcomponentWillReceiveProps
.
Added effects useEffect
and useLayout
to replace them all.
-
Removed
componentDidCatch
being replaced by a singleBoundary
component. -
Removed
createFactory
,createComment
. -
Removed
Component
,PureComponent
and class components in general. -
Removed
createPortal
andcreateContext
being replaced byPortal
andContext
components respectfully.
- Patch #65
- New:
forwardRef
top-level API. - New:
createRef
top-level API. - Improvements to Error Boundary implementation.
- Improvements to
createElement
implementation.
- Patch #59
- Patch
select
element preventing default browser option selection behavior.
- Patch
shouldComponentUpdate
preventing state update.
- Breaking: Improve Error Boundaries to behave more inline with React and
try..catch
heuristics. - Improve:
async getInitialState
implementation. - Improve: support for
defaultValue
on select elements. - New:
createClass
top-level API. - New:
createContext
top-level API. - New:
createComment
top-level API. - New: support async generators/iterators.
- New: support auto resolution of json
fetch
based Promises passed to setState/getInitialState. - New: support custom element constructors.
- New: support multiple event handlers on a single event.
- Breaking: Name change to custom reconcilers method
getProps
togetInitialProps
. - Breaking: Name change to custom reconcilers method
setContent
tosetDocument
. - NEW:
getUpdatedProps
reconciler API. - NEW:
getContext
reconciler API. - NEW:
createComment
reconciler API. - NEW:
setComment
reconciler API. - NEW:
willUnmount
reconciler API.
- Patch nested rendering with children array.
- patch children props sementics when coupled with both children props and children elements to behave like React and prefer children elements instead of the accumulation of both.
- patch async setState in
componentWillMount
lifecycle to work on server-side renderer.
- patch order of calling component ref when unmounting.
- patch server side rendering, call to
componentWillMount
lifecycle.
- Produce an ESM module bundle.
- Improve reconciler.
- Improvements to treatment of static cached/hoisted children.
- Adds top-level API
createFactory
to create element or renderer factories. - Adds
Children.find
andChildren.filter
to the top-levelChildren
API. - Adds support for cross-realm element construction/consumption.
- Improvements to the reconciler.
- Improves importing async components with
import(...)
. - Fix #39 hydration of differing text node length.
- Fix #40 improves handling static hoisted elements.
The createFactory
API can be used to create element factories and additionally provides an interface to create client renderers that can target different platforms/targets.
The Children.find
API works like the Array.find
API in that it allows you find a single element from the opaque children data-structure.
The Children.filter
API works like the Array.filter
API in that it allows you filter elements from the opaque children data-structure.
The reconciler has gone through some improvments that aim to insure the shorterst path is taken to reach a reconciled state.
This release includes improvements to the way(syntax sugar) you can dynamically import components.
// A.js
export default class {
render() {}
}
// Before
class {
render() {
return import('./A.js').then(A => A.default)
}
}
// After
class {
render() {
return import('./A.js')
}
}
- patch error when used with brunch, fusebox and browserfy bundlers.
- reflect
setState
calls fromcomponentWillReceiveProps
lifecycle to update state synchronously like React.
- patch
dio.version
to reflect the right version.
- Support
componentDidCatch
. - Support
stateful
functional components. - Support rendering fragments.
- Support rendering Iterables.
- Support EventListener interface.
- Support
context
, getChildContext. - Support strings refs for functional components.
- Support an opaque data-structure for
props.children
- Support mounting to top-level
html
element. - Support out of order server side rendering with portals.
- Adds top-level API
createPortal
. - Adds top-level API
findDOMNode
. - Adds top-level API
hydrate
. - Adds top-level API
Children
. - Adds top-level API
unmountComponentAtNode
- Adds invarient errors for
render
if target container is invalid.
-
componentDidThrow
is renamed tocomponentDidCatch
and unmounts the DOM if an error state is left unhandled. However errors coming from event handlers are exluded from this behaviour. -
props.children
is now an opaque data-structure, which might break your application if you relied on it always being of anArray
type. -
Passing an invalid object to
#render
as the container to render to will throw an error. Falsey values are not considered invalid values, these will fallback to theroot
Node in a DOM tree. Truethy values that are not of or do not extend/mimic the nativeNode
class of the platform would be considered invalid. -
Hydration now exists soley as an explicit API
hydrate
. -
Hydration will now always try to make sure the DOM matches the virtual elements generated on the client. This may result in removing nodes or adding DOM nodes. This only bears any meaning if the server and client renders do not match in which case the reconciler will always try to make the DOM match what you render on the client.
- Allow lazy loading primitive to render while loading module.
- Improve Promise return types.
- bypass
shouldComponentUpdate
when coming fromforceUpdate
. - patch
Components
to not require passing props tosuper()
. - patch missing value in
DOM
attributes that use the primitvetrue
value.
- handle invalid values for
style
prop
- patch compatibility with "Web Components" classes
- patch mounting portals
- patch clone element
- patch compatibility with webpack
- reduced api surface
Apart from that improvements where mostly internal facing, like improving async return types lifecycles on functional components, new architecture to support pausing and resuming tree updates and more.
// client side
{
render,
createElement,
h,
Component,
version
}
// server side
{
...,
shallow
}
renderToString is supplimented by h(..).toString()
in a server enviroment which means we could just do this ${h(..)}
renderToStream is supplimented by dio.render
which also supports rendering to a writable stream
on the server like the Node.js Response
object and h(..).toStream()
, dio.render
however also handles streaming json responses and will set the correct MIME type if one hasn't been set.
- patch pure function components
- include pure function components in error boundries
- improve reconciler
- improve internal component property naming to avoid possible user-land naming conflicts
- improve hydration
- add DOMNodes to return types
- returning a DOMNode from render auto creates a portal
h
andcreateElement
now support DOM(portal), array(fragment), element(clone), null/void(empty) as the type param- add first class support for portals
- patch short hand class construction
cons Foo = h => (props, state) => h('h1', state.name)
- exposes internal css compiler
dio.stylesheet
- You can now register middleware/plugins for the css compiler
dio.stylesheet.use()
- improve error boundary logs
- patch for string
style
props - use faster timers where available to schedule an async task
- patch error boundaries to support
stylesheet
- patch error boundaries to support error boundry handler
componentDidThrow
- patch stylesheet, prevents adding styles to components that return components that return text nodes
- patch stylesheet, support adding namespacing to components that return components recursively
- adds async component support for
getInitialProps
on the server and client - adds render types, render supports
coroutine/element/number/string/function/component/array/promise
- adds error boundaries to components for non-breaking graceful error state handling
- improves keyed algorithm
- add support for passive event listeners
{onClick: {handler: () => {}, options: {passive: true}}}
- add style support for css variables
style: {'--color': 'red',color: 'var(--color)'}
- add typescript definitions
- patch minfied bundle
- patch http to trigger catch handler if status is fasley or
>= 400
- patch http to allow
dio.request({string})
to aliasdio.request.get({string})
- update the css compiler
- patch
defaultProps
&getDefaultProps
- better intergrate hydration with SSR stylesheets
- use component name/function name/displayName for css namespaces when available
- patch for hoisted nodes when hydrating SSR content
- patch for cloning fragments when hoisted
- patch performance regression between v4 and v5
- patch nano
- perf improvements
- render now accepts a callback argument
.render(vnode, target, callback(root))
- support string refs
- add shallow render
dio.shallow
- render is now no-destructive to the mount node
- hydration is now configurable
.render(vnode, target, null, true)
- hydration is the only breaking change, pre 5.0 used an attribute
hydrate
- improvement in handling callbacks passed to
.forceUpdate
- bump css compiler
- improve performance
- improve SSR
- introduce non-blocking async hydration
- introduce constructor to createClass, remove auto binding
- remove
autoBind
method from Components - intergrate support for two-way data binding on events and binding data to a function
- support empty/null render
- support changing component root nodes
- remove all utilities except
stream
- add router methods
pause
,resume
,set
,resolve
,destroy
andlocation
getter/setter - add support for
responseType
torequest
- remove all helper methods from streams except
resolve
andreject
- improve css compiler
- introduce packages
- handle setting a style property to false i.e
style.color = state.id && "red"
to remove it - improve stylesheet compiler.
- improve stylesheet compiler
- handle the removal of hoisted elements to avoid memory leaks
- add
.stylis
to expose internal css compiler
- at root support to
dio.stylesheet
for pushing to root@root {...}
- patch
dio.stylesheet
handling{}
when used without&
like&{}
- improve performance of
dio.escape
- add
dio.renderToStream
- add
dio.renderToCache
- patch
dio.flatten
- improve performance of escaping SSR
- add
dio.escape
- patch stylesheet to use valid html attribute for namespacing
scope
becomesdata-scope
- escape props and textNodes for server-side rendering
- improve
stylesheet
parser, now more forgiving i.e trailing;
is optional - patch to
stylesheet
prefixer for transforms and appearance - patch to
stylesheet
to handle minified css - patch
dio.input
eof - all round the stylesheet parser is now better at handling multiple input styles
- patch stylesheet to support loose formatting i.e
leaving out ; at end of declaration
- patch
dio.input
end of file.eof
- patch stylesheet @media queries encapsulation
- add
.pos
todio.input
to retrieve current caret position - add
dio.stream.resolve
to match promise spec - add
dio.stream.reject
to match promise spec - patch compatibiliy of
dio.stream
with ES6 async & await
- patch stylesheet encapsulation with pure functions
- add support for style encapsulation
- improve server side rendering
- move code baseto modularity approach
- added stylesheet component method
- removed injectWindowDependency()
- removed registerEnviroment()
- removed
Array
,Object
andEvent
utilities - added
input
,panic
,sandbox
andrandom
utilities - rename
curry
utility todefer
- rename
animateWith
toanimate
- patch
dio.renderToString
className should map to class - patch
dio.Children.only
- improve compatibility with commonJS enviroments
- add
dio.unmountComponentAtNode
top level api, mirrorsReact
- add
dio.applyMiddleware
,dio.combineReducers
anddio.compose
to top level api
- add
dio.Children
top level api, mirrorsReact
- better intergration with webpack
- patch
dio.createElement
rename conflict - patch
dio.createElement
assign children components - patch assignment of component
this.props.children
- patch issue with es6 Components class
.defaultProps
not registering - pathc redux store initialState
- more performance tweaks to (SSR, hydration, mounting, patching)
- expose internal VNode creation helpers
- added
dio.VText
- added
dio.VElement
- added
dio.VFragment
- added
dio.VSvg
- added
dio.VComponent
- added
dio.VBlueprint
- added
dio.DOM
, like React.DOM, but only initialized when called
- tweaks to allow more performance optimizations when needed
- add
dio.findDOMNode
- performance, performance, performance.
dio.render
replacesdio.createRender
dio.createClass
replacesdio.createComponent
dio.renderToString
replacesdio.createHTML
dio.router
replacesdio.createRouter
dio.stream
replacesdio.createStream
- push back
createFactory
to support react-like single element factories - removed
componentDidUnmount
lifecycle method not to be confused withcomponentWillUnmount
- pushed utilities to the
dio
namespace, removeddio._
namespace - utility
dio.splice
replacesdio.toArray
- added ``flatten
,
splice`, `slice` utilities - added
nodeType
to compiled vnodes,1
forElement
,3
forTextNode
- patch .createRender/.render caching
- added caching to .createRender/.render
dio.render(Component, '.app')();
dio.render(Component, '.app')();
// on the above code the second example will avoid
// creating a component and render instance a second time
// and will rather return a cache of the render instance
// except in the case that the mount is different
- Improve performance
- componentWillUpdate & componentDidUpdate now also fire when a parent component re-renders
- Improves performance in various ways
- Added fragment support, you can now return a fragment/array of elements in render
- Added all the react land PropTypes
[
number, string, bool, array, object, func, element, node
any, shape, instanceOf, oneOf, oneOfType, arrayOf, objectOf
]
- Added middleware support.
dio.createStore(reducer(s), initalState, enhancer)
- Added
version
,isValidElement
,cloneElement
,renderToString
,renderToStaticMarkup
- Exposes internal utilities to
dio._
that are used to get out-the-box support for IE 8+
toArray
assign (Object.assign)
keys (Object.keys)
forEach ([]/{}.forEach)
reduce ([].reduce)
reduceRight ([].reduceRight)
filter ([].filter)
map ([].map)
isObject
isFunction
isString
isArray
isDefined
addEventListener