Ivi

24.08.2019
  1. Ivins Utah
What a great hotel, if your going to Paphos this hotel is a no brainer. It’s brand new hence there is not many reviews, the management and staff are 10/10 all round. They come around very regular and talk to you and make sure we are happy The pool area is perfect to relax, even the children at the hotel have there own pool and section, so us adults didn’t hear a sound from them which was great, Breakfast was brilliant with a great selection and the bars are really nice with cocktails at €8 each . The 2 restaurants were not for us so we went out most nights, but people sitting around us said the food at the Greek restaurant was nice so we tried it the last night and then wished we had tried it earlier. Going to the harbour is a good 25mins walk and a taxi is €8 each way. Just make sure you book your taxi from the airport in advance or they will charge you €35/40 maybe more pending what mood they are in !!!! Email the hotel and let them organise it for you or book it yourself via steviestaxi in Paphos who have a good system. On way back to airport we paid €20 only Good luck and hope you enjoy this hotel as much as we did

Book Louis Ivi Mare, Paphos on TripAdvisor: See 80 traveler reviews, 341 candid photos, and great deals for Louis Ivi Mare, ranked #2 of 77 hotels in Paphos and rated 5 of 5 at TripAdvisor. IVI-C IVI-COM; Included in Approved IVI Specification: Since August 1998 (IVI 1.0 based on IVI-C) Since January 2003: Source Code Availability (for message-based instruments).

ivi is a javascript (TypeScript) library for building web user interfaces.

  • Declarative rendering with 'Virtual DOM'
  • Powerful composition model
  • Immutable 'Virtual DOM'
  • Synchronous and deterministic reconciliation algorithm with minimum number of DOM operations
  • Extensible synthetic events
  • Server-side rendering

Library Size

ivi has a tree shakeable API, so it can scale from simple widgets to complex desktop applications.

Small library size is important, but in complex applications, major reduction in the code size will come from thepowerful composition model that allows to write reusable code.

Size of the basic examplebundled with Rollup and minified withterser is just a 2.7KiB (minified+compressed).

Size of the TodoMVC application is 4.6KiB (minified+compressed).

Quick Start

Hello World

The easiest way to get started with ivi is to use this basic example on CodeSandbox.

The smallest ivi example looks like this:

render() function has a standard interface that is used in many Virtual DOM libraries. First argument is used tospecify a Virtual DOM to render, and the second one is a DOM node that will be used as a container.

Virtual DOM API in ivi is using factory functions to instantiate Virtual DOM nodes.

Factory functions for HTML elements are declared in the ivi-html package.

h1() function will instantiate a 'Virtual DOM' node for a <h1> element.

_ is a shortcut for an undefined value.

Components

Components API were heavily influenced by the new React hooks API.

There are several differences in the ivi API because we don't need to support concurrent rendering, and because of it wecould try to solve some flaws in the React hooks API design:

  • Excessive memory allocations each time component is updated
  • 'Memory leaking' caused byclosure context sharing

All components has an interface (component) => (props) => VDOM.

Outer function is used to store internal state, creating dataflow pipelines, attaching hooks and creating an 'update'function. It is important that outer function doesn't have any access to the props to prevent unexpected'memory leaks'. component is an opaque object, it is used as a first argument for almost all component functions likeinvalidate(), useEffect() etc.

Internal 'update' function passes input data through dataflow pipelines and returns a Virtual DOM.

component() function creates Virtual DOM factory functions for component nodes. All component factory functions has aninterface Factory(props).

In the outer function we are declaring internal state counter.

useEffect() creates a function that will be used to perform side effects. Side effect functions can optionally returna cleanup function, it will be automatically invoked when component is unmounted from the document or when inputproperty interval is modified.

Side effect function ticker() registers a timer function that is periodically invoked and increments counter fromthe internal state. When internal state is modified, we need to trigger an update for the component. To trigger anupdate, we are using invalidate() function. Invalidate function will mark component as dirty and enqueue a task fordirty checking.

Periodic timers registered with setInterval() function should be unregistered when they are no longer used. Tounregister periodic timer we are creating and returning a cleanup function () => clearInterval(id).

The final step for a component is to create an 'update' function, it should pass input data through dataflow pipelinesand return a Virtual DOM. Update function will be invoked when component is invalidated or component properties aremodified.

Stateless Components

One of the unique features in ivi is that it doesn't store any magic properties like keys on 'Virtual DOM' nodes.Decoupling magic properties from 'Virtual DOM' nodes allows us to use simple immediately invoked functions asstateless components.

Virtual DOM

Virtual DOM term is usually associated with diffing algorithms, but the problem with this definition is that almostall efficient declarative libraries are using diffing algorithms. And all feature complete libraries implement the samediffing algorithms to deal with use cases like dynamic attributes <div {..domProps}></div>, children lists diffing,etc.

What makes a real difference between Virtual DOM and other technologies is that it provides an easy to use API withsimple composable primitives so that you can use javascript for composition without any specialized compilers.

Performance

Recently there were a lot of misleading articles aboutVirtual DOM 'overhead'. This article shows the simplest problemthat declarative rendering libraries are solving and presents an obvious solution with direct DOM mutations and fromthis solution they are making a conclusion that if it is possible to solve this problem without this overhead, it meansthat Virtual DOM is a pure overhead. But imagine a slightly more complicated problem:

The main problem in this example is that we render several adjacent components that has conditional rendering at theroot node, so when showTitle property is changed we need to figure out where to insert DOM node that will be renderedin PopupTitle component. It is possible that previous and next adjacent components doesn't have any DOM nodes at thistime, so how we can figure out where to insert our new DOM element? Libraries like Svelte unable to deal with suchproblems efficiently and will insert additional DOM node in conditional statements as a marker that will be used toinsert other nodes.

Everything gets even more complicated with features like components, fragments, transclusion, context propagation, etc.All this features are so intertwined when implemented efficiently and there are many different constraints because itshould work on top of the DOM API, and it is not so easy to optimize DOM operations for different browsers and browserenvironments. Some popular browser extensions add an additional overhead to many DOM operations, so it becomesextremely important to touch DOM as little as possible and avoid polluting document with useless DOM nodes.

To get a better understanding how all this 'faster than Virtual DOM' libraries scale when we move from basic DOMprimitives to a much more complicated composition primitives we can try to gradually add this primitives to theirjs-framework-benchmarkimplementations. Results in aclean chrome andchrome with uBlock origin extensionclearly shows that there are a lot of issues with their performance. In this repository, implementations with a suffix-0 are abusing techniques like event delegation, etc. Then we start to gradually add components, conditionalrendering, etc. ivi-5 is a special variant that performs a full-blown rerender without any shouldComponentUpdateoptimizations (diffing 10k-100k virtual dom nodes per update).

If you really want to get any useful information from this benchmark, I'd recommend to do the same experiment with yourfavorite UI library.

ivi is optimized for predictable performance, there are no perf cliffs when you start using any compositionprimitives.

Another argument that is often used against virtual DOM libraries is that components in real applications have expensiveuser space computations, so it isn't a virtual DOM diffing problem anymore :) But there is another problem, theirsolutions won't be able to magically remove expensive user space computations from components, so when we instantiatecomponents we still need to perform this computations with an additional overhead to setup change detection graphs orgenerate additional code to optimize micro updates. It is as bad as using PureComponent in all React components, mostof the time it isn't even worth it. And when we have a really computationaly expensive task, we can easily solve it withmemoization useMemo() in React or memo() in ivi. There aren't any silver bullet solutions. Solutions withfine-grained observable graphs will have a similar developer experience because it would require to wrap expensivecomputations into lazy evaluated nodes @computed in a similar way to memo() in virtual DOM libraries. And solutionsthat generate a lot of inefficient code for change detection (Svelte) should solve performance issues with common casescenarios before making any claims about performance.

'The Fastest UI Library'

There is no such thing as 'the fastest UI library', optimizing UI library for some use cases will make it slower inother use cases.

There are many different optimization goals and we need to find a balanced solution. Here is a list of differentoptimization goals (in random order) that we should be focusing on:

  • Application code size (reduce compilation output, composable primitives, tree-shakeable and minifiable APIs)
  • Library code size
  • Time to render first interactive page
  • Creating DOM nodes
  • Updating DOM nodes
  • Initialization of internal state
  • Cleaning up internal state
  • Memory usage
  • Garbage collection
  • Composition patterns performance (components, conditional rendering, transclusion, fragments, dynamic attributes, etc)
  • Reduce impact of polymorphism
  • Increase probability that executed code is JITed (reuse the same code path for initial rendering and updates - VirtualDOM, modern fine-grained DOM binding solutions like Surplus/Solid and modern incremental DOM solutions like Angular ivy)

Performance Benchmarks

There are no good ways how to compare performance of different libraries, and there are issues with existing benchmarks:

  • Benchmark tests are usually so simple, so it is possible to create a specialized code path in the library that willwork fast in this simple conditions, give this feature a name like 'optimization hints' and focus on performance of thissmall subset of a library.
  • Some benchmark implementations are abusing different techniques toget an edge over other implementations:explicit event delegation,workarounds to reduce number of data bindings.
  • Benchmarks are usually biased towards some type of libraries.

But any flawed benchmark is still way much better than 'common sense' that is used by some library authors to explainwhy their libraries are 'faster'.

To explain how to make sense from numbers in benchmarks I'll usethe most popular benchmark. It contains implementations for manydifferent libraries and ivi isamong the fastest libraries in this benchmark, evenwhen benchmark is biased towards libraries that use direct data bindings to connect observable data with DOM elements.ivi implementation doesn't abuseany 'advanced' optimizations in this benchmark and implemented in almost exactly the same way asreact-redux implementation.

There are several important characteristics that can skew benchmark results in favor of some library type:

  • Number of DOM Elements
  • Ratio of DOM Elements per Component
  • Ratio of Event Handlers per DOM Element
  • Ratio of Dynamic Data Bindings per DOM Element
  • Ratio of Components per Component Type

Number of DOM Elements

In some test cases of this benchmark there is an insane amount of DOM elements (80000). Usually when there are so manyDOM elements in the document, recalc style, reflow, etc will be so slow, so it doesn't matter how fast is UI library,application will be completely unusable.

Libraries that are using algorithms and data structures that can easily scale to any number of DOM elements willobviously benefit from such insane numbers of DOM elements.

Ratio of DOM Elements per Component

Since benchmark doesn't impose any strict requirements how to structure benchmark implementation, many implementationsjust choosing to go with the simplest solution and implement it without any components. Whatsapp apk download for android free.

When there are no components or any other form that is used by the library to create reusable blocks, it is hard toguess how library will perform in a scenario when you decompose your application into reusable blocks 'components'. Andfor some libraries, reusable blocks has a huge impact on performance, since they were optimized just to deal withlow-level primitives.

Ivi

Ratio of Event Handlers per DOM Element

There also no strict requirements how to handle user interactions, and some implementations are using explicit eventdelegation to reduce the number of event handlers:

  • etc..

Any library in this benchmark can use this technique to reduce the number of event handlers, so when comparing numbersit is important to keep in mind that some implementations show better numbers only because they've decided to useexplicit event delegation.

Ratio of Dynamic Data Bindings per DOM Element

The ratio of dynamic data bindings per DOM element in this benchmark is 0.25. Such low number of data bindings is ahuge indicator that benchmark is biased toward libraries with fine-grained direct data bindings, and some librariesareusing workarounds to reduce this ratio to 0.125.

Just take a look at any library that implements a set of reusable components, the number of dynamic bindings per DOMelement is usually greater than 1. Virtual DOM libraries by design are trying to optimize for use cases when the ratioof data bindings per DOM element is greater or equal than 1.

Ratio of Components per Component Types

Benchmark implementations with zero components are obviously have zero component types. When there are no components,libraries that generate 'optimal' code and don't care about the size of the generated code, and the amount of differentcode paths will have an advantage in a microbenchmark like this.

But in a complex application it maybe worthwile to reduce the amount of the generated code instead of trying to optimizemicro updates by a couple of microseconds. Virtual DOM libraries are usually have a compact code, because they are usinga single code path for creating and updating DOM nodes, with no additional code for destroying DOM nodes. Single codepath has an additional advantage that it has a higher chances that this code path will be JITed earlier.

Documentation

Operations ('Virtual DOM')

Virtual DOM in ivi has some major differences from other implementations. Events and keys are decoupled from DOMelements to improve composition model. Simple stateless components can be implemented as a basic immediately executedfunctions, DOM events can be attached to components, fragments or any other node.

Internally, all 'Virtual DOM' nodes in ivi are called operations and has a type Op.

Element Factories

All factory functions that create DOM elements have an interface:

ivi-html package contains factories for HTML elements.

ivi-svg package contains factories for SVG elements.

Element Prototypes

Element prototypes are used to create factories for elements with predefined attributes.

Fragments

All virtual dom nodes and component root nodes can have any number of children nodes. Fragments and dynamic childrenlists can be deeply nested.

Fragments Memoization

Fragments in ivi can be memoized or hoisted like any other node. Because ivi doesn't use normalization to implementfragments, memoized fragments will immediately short-circuit diffing algorithm.

Events

Synthetic events subsystem is using its own two-phase event dispatching algorithm. Custom event dispatching makes itpossible to decouple event handlers from DOM elements and improve composition model.

Events() operation is used to attach event handlers. events argument can be a singular event handler, null orrecursive array of event handlers.

Stop Propagation

Event handler should return true value to stop event propagation.

Context

contextValue() creates context getter get() and operation factory for context nodes set().

TrackByKey

TrackByKey() operation is used for dynamic children lists.

Attribute Directives

By default, reconciliation algorithm assigns all attributes with setAttribute() and removes them withremoveAttribute() functions, but sometimes we need to assign properties or assign attributes from differentnamespaces. To solve this problems, ivi introduces the concept of Attribute Directives, this directives can extend thedefault behavior of the attributes reconciliation algorithm. It significantly reduces code complexity, because we nolonger need to bake in all this edge cases into reconciliation algorithm. Also it gives an additional escape hatch tomanipulate DOM elements directly.

There are several attribute directives defined in ivi packages:

PROPERTY() function creates an AttributeDirective that assigns a property to a property name derived from the keyof the attribute.

UNSAFE_HTML() function creates an AttributeDirective that assigns an innerHTML property to an Element.

AUTOFOCUS() function creates an AttributeDirective that triggers focus when value is updated from undefined orfalse to true.

VALUE() function creates an AttributeDirective that assigns a value property to an HTMLInputElement.

CONTENT() function creates an AttributeDirective that assigns a value property to HTMLTextAreaElement.

CHECKED() function creates an AttributeDirective that assigns a checked property to an HTMLInputElement.

XML_ATTR() function creates an AttributeDirective that assigns an attribute from XML namespace, attribute name isderived from the key.

XLINK_ATTR() function creates an AttributeDirective that assigns an attribute from XLINK namespace, attribute nameis derived from the key.

Example
Custom Attribute Directives

First thing that we need to do is create an update function. Update function has 4 arguments: element will containa target DOM element, key is an attribute name that was used to assign this value, prev is a previous value andnext is the current value.

In this function we are just checking that the value is changed, and if it is changed, we are assigning it to the_custom property.

To support server-side rendering we also need to create a function that will render attribute directive to string.

Now we need to create a function that will be used to instantiate AttributeDirective objects.

Additional functions

Trigger an update

requestDirtyCheck() function requests a dirty checking.

Rendering virtual DOM into a document

render() function assigns a new virtual DOM root node to the container and requests dirty checking.

Components

Virtual DOM node factory

component() function creates a factory function that will instantiate component nodes. Factory function can have upto two properties P1 and P2.

By default, all components and hooks are using strict equality operator as areEqual function.

Hooks

useEffect()

useEffect() lets you perform side effects. It is fully deterministic and executes immediately when function createdby useEffect() is invoked. It is safe to perform any subscriptions in useEffect() without losing any events.

useMutationEffect()

useMutationEffect() lets you perform DOM mutation side effects. It will schedule DOM mutation task that will beexecuted immediately after all DOM updates.

useLayoutEffect()

useLayoutEffect() lets you perform DOM layout side effects. It will schedule DOM layout task that will be executedafter all DOM updates and mutation effects.

useUnmount()

useUnmount() creates a hook that will be invoked when component is unmounted from the document.

hook function always receives UNMOUNT_TOKEN as a first argument, it can be used in micro optimizations to reducememory allocations.

Additional Functions

invalidate()

invalidate() marks component as dirty and requests dirty checking.

Using a Custom Hook

Pass Information Between Hooks

Accessing DOM Nodes

getDOMNode() finds the closest DOM Element.

Observables and Dirty Checking

Ivins Utah

Observables in ivi are designed as a solution for coarse-grained change detection and implemented as a directed graph(pull-based) with monotonically increasing clock for change detection. Each observable value stores time of the lastupdate and current value.

Observables can be used to store either immutable tree structures or mutable graphs. Since ivi is fully deterministic,there isn't any value in using immutable data structures everywhere, it is better to use immutable values for smallobjects and mutable data structures for collections, indexing and references to big objects.

Observable

observable() creates an observable value.

assign() assigns a new value.

mut() updates time of the last update and returns current value.

Watching observable values

watch() adds observable or computed values to the list of dependencies. All dependencies are automatically removedeach time component or computed value is updated.

Computeds

computed() creates computed value that will be evaluated lazily when it is requested.

Signals

Signals are observables without any values.

signal() creates a new signal.

emit() emits a signal.

Watching a subset of an Observable object

Computeds are using strict equality as an additional change detection check. And we can use it to preventunnecessary computations when result value is the same.

Portals

Portals are implemented in the ivi-portal package. It has a simple API:

portal() function creates a Portal instance that has a root node and an entry() function. root node is used torender a portal root and entry() function renders elements inside of a portal.

rootDecorator argument can be used to provide a decorator for a root node, by default it is a simple identity function(v) => v.

Example

Environment Variables

NODE_ENV

  • production - Disables runtime checks that improve development experience.

IVI_TARGET

  • browser - Default target.
  • evergreen - Evergreen browsers.
  • electron - Electron.
  • ssr - Server-side rendering.

Webpack Configuration

Rollup Configuration

Internal Details

ivi reconciliation algorithm is implemented as a synchronous and deterministic single pass algorithm with immutableoperations. The difference between single pass and two pass algorithms is that we don't generate 'patch' objects andinstead of that we immediately apply all detected changes.

One of the major ideas that heavily influenced the design of the reconciliation algorithm in ivi were that instead ofoptimizing for an infinitely large number of DOM nodes, it is better to optimize for real world use cases. Optimizingfor a large number of DOM nodes doesn't make any sense, because when there is an insane number of DOM nodes in thedocument, recalc style, reflow, hit tests, etc will be so slow, so that application will be completely unusable. That iswhy ivi reconciliation algorithm always starts working from the root nodes in dirty checking mode. In dirty checkingmode it just checks selectors and looks for dirty components. This approach makes it easy to implement contexts,selectors, update priorities and significantly reduces code complexity.

Children reconciliation algorithm is using pre-processing optimizations to improve performance for the most common usecases. To find the minimum number of DOM operations when nodes are rearranged it is using aLIS-based algorithm.

Synthetic events are usually implemented by storing references to Virtual DOM nodes on the DOM nodes, ivi is using adifferent approach that doesn't require storing any data on the DOM nodes. Event dispatcher implements two-phase eventflow and goes through Virtual DOM tree. Synthetic events allows us to decouple events from DOM elements and improvecomposition model.

Immutable 'Virtual DOM'

When I've implemented my first virtual dom library in 2014, I've used mutable virtual dom nodes and I had no idea how toefficiently implement it otherwise, since that time many other virtual dom libraries just copied this terrible idea, andnow it is everywhere. Some libraries are using differentworkarounds to hide that they are using mutable virtual dom nodes, but this workarounds has hidden costs when mutablenodes are passed around.

ivi is using immutable virtual dom like React does, and it is still has an extremely fast reconciler, there are no anyhidden costs, zero normalization passes, nothing gets copied when dealing with edge cases.

Children Reconciliation

Children reconciliation algorithm in ivi works in a slightly different way thanReact children reconciliation.

There are two types of children lists: fragments (javascript arrays) and dynamic children lists (TrackByKey()nodes).

Fragments are using a simple reconciliation algorithm that matches nodes by their position in the array. When fragmentlength is changing, nodes will be mounted or unmounted at the end of the fragment.

Dynamic children lists are wrapped in a TrackByKey() nodes, each node in dynamic children list should be wrapped in aKey object that should contain unique key. Dynamic children list algorithm is using aLIS-based algorithm to find a minimum number of DOMoperations.

Finding a minimum number of DOM operations is not just about performance, it is also about preserving internal stateof DOM nodes. Moving DOM nodes isn't always a side-effect free operation, it may restart animations, drop focus, resetscrollbar positions, stop video playback, collapse IME etc.

Defined Behaviour

This is the behaviour that you can rely on when thinking how reconciliation algorithm will update dynamic childrenlists.

  • Inserted nodes won't cause any nodes to move.
  • Removed nodes won't cause any nodes to move.
  • Moved nodes will be rearranged in a correct positions with a minimum number of DOM operations.

Undefined Behaviour

Moved nodes can be rearranged in any way. [ab] => [ba] transformation can move node a or node b. Applicationsshouldn't rely on this behaviour.

Caveats

Legacy Browsers Support

React is probably the only library that tries hard to hide all browser quirks for public APIs, almost all otherlibraries claim support for legacy browsers, but what it usually means is that their test suite passes in legacybrowsers and their test suites doesn't contain tests for edge cases in older browsers. ivi isn't any different frommany other libraries, it fixes some hard issues, but it doesn't try to fix all quirks for legacy browsers.

Component Factories Ambiguity

Stateless components implemented as immediately executed functions won't have any nodes in a 'Virtual DOM' tree andreconciliation algorithm won't be able to detect when we are rendering completely different components.

In this example, when condition is changed, instead of completely destroying previous <div> element andinstantiating a new one, reconciliation algorithm will reuse <div> element.

Rendering into <body>

Rendering into <body> is disabled to prevent some issues.If someone submits a good explanation why this limitation should be removed, it is possible to remove this limitationfrom the code base.

Rendering into external Document

Rendering into external Document (iframe, window, etc) isn't supported.

Server-Side Rendering

There is no rehydration in ivi.It isn't that hard to implement rehydration, but it would require someone who is interested in it to maintain this codebase.

Primary use case for server-side rendering in ivi is SEO. Usually when SSR is used for SEO purposes, it is better touse conditional rendering with process.env.IVI_TARGET and generate slightly different output by expanding allcollapsed text regions, etc.

Synthetic Events

Synthetic events subsystem dispatches events by traversing state tree. Worst case scenario is that it will need totraverse entire state tree to deliver an event, but it isn't the problem because it is hard to imagine an applicationimplemented as a huge flat list of DOM nodes.

All global event listeners for synthetic events are automatically registered when javascript is loaded. ivi is relyingon dead code elimination to prevent registration of unused event listeners. React applications has lazy event listenersregistration and all global event listeners always stay registered even when they aren't used anymore, it seems thatthere aren't many issues with it, but if there is a good explanation why it shouldn't behave this way, it is possible toadd support for removing global event listeners by using dependency counters.

There are no onMouseEnter() and onMouseLeave() events, here is an example howto implement the same behavior using onMouseOver() event.

onTouchEnd(), onTouchMove(), onTouchStart() and onWheel() arepassiveevent listeners. onActiveTouchEnd(), onActiveTouchMove(), onActiveTouchStart() and onActiveWheel() will addactive event listeners.

Ivi

Dirty Checking

Dirty checking provides a solution for a wide range of edge cases. Dirty checking always goes through entire statetree, checks invalidated components, selectors, observables, propagates context values and makes it possible toefficiently solve all edge cases with nested keyed lists, fragments, holes (null ops).

Dirty checking is heavily optimized and doesn't allocate any memory. To understand how much overhead to expect fromdirty checking algorithm, we can play with a stress test benchmark for dirty checking:https://localvoid.github.io/ivi-examples/benchmarks/dirtycheck/ (all memory allocations are from perf-monitor counter)

This benchmark has a tree structure with 10 root containers, each container has 10 subcontainers and each subcontainerhas 50 leaf nodes. Containers are DOM elements wrapped in a stateful component node with children nodes wrapped inTrackByKey() operation, each leaf node is a DOM element wrapped in a stateful component node with text child nodewrapped in a fragment and Events() operation, also each leaf node watches two observable values. It creates so manyunnecessary layers to get a better understanding how it will behave in the worst case scenarios.

Unhandled Exceptions

ivi doesn't try to recover from unhandled exceptions raised from user space code. If there is an unhandled exception, itmeans that there is a bug in the code and bugs lead to security issues. To catch unhandled execptions, all entry pointsare wrapped with catchError() decorator. When unhandled exception reaches this decorator, application goes into errormode. In error mode, all entry points are blocked because it is impossible to correctly recover from bugs.

addErrorHandler() adds an error handler that will be invoked when application goes into error mode.

Portals

Portal implementation relies on the reconciler execution order.

Reconciler always mounts and updates nodes from right to left and this example won't work correctly:

To fix this example, we should either place portal roots before components that use them:

Or render them in a different container:

Root nodes are always updated in the order in which they were originally mounted into the document.

Custom Elements (Web Components)

Creating custom elements isn't supported, but there shouldn't be any problems with using custom elements.

Examples and demo applications

CodeSandbox

Apps

  • TMDb movie database by @brucou

Benchmarks

License

Comments are closed.