Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency inferno to v7 #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Aug 20, 2019

This PR contains the following updates:

Package Type Update Change
inferno dependencies major 5.0.3 -> 7.3.3

Release Notes

infernojs/inferno

v7.3.3

Compare Source

Inferno Router

  • History package updated to v4.10.1

Inferno Redux

  • Provider component typings fixed #​1495

All internal dependencies updated

v7.3.2

Compare Source

Inferno core

  • Fixes an issue where inferno does not load in IE8 #​1491

v7.3.1

Compare Source

Inferno-hydration

  • Fixes an issue where hydrating forwardRef Component crashed #​1486 646753c

v7.3.0

Compare Source

Inferno-core

v7.2.1

Compare Source

Inferno-core

  • Fixes an issue caused by Release 7.2.0 where events were not updated correctly be677f9
  • Simplified and optimized Synthetic event patch routines

v7.2.0

Compare Source

Inferno-core

  • Adds support for defaultHooks when using forwardRef functional components
  • Fixes performance regression between 7.0.2 and 7.1.13

General

  • All dependencies updated
  • UglifyJS has been replaced with TerserJS

v7.1.13

Compare Source

Inferno-core

  • Fixes a bug where extending forwardRef component was not possible #​1473

Inferno-devtools

  • Fixes a bug where inferno-devtools did not start #​1479

v7.1.12

Compare Source

Inferno core

  • Fixes an issue where value of Inferno.createRef() did not update correctly #​1465 #​1466
  • Fixes an issue where <select> element selectIndex attribute was rendered to DOM #​1468

v7.1.11

Compare Source

Inferno-core

Example:

    class Foo extends Component {
        // just added to force the warnings
        static getDerivedStateFromProps() { }

         componentWillMount() { }

         componentWillReceiveProps() { }

         componentWillUpdate() { }

         render() {
             return <div>Foo</div>;
         }
    }

    Foo.prototype.componentWillMount.__suppressDeprecationWarning = true;
    Foo.prototype.componentWillReceiveProps.__suppressDeprecationWarning = true;
    Foo.prototype.componentWillUpdate.__suppressDeprecationWarning = true;

v7.1.10

Compare Source

Inferno-test-utils

Removed props.children from snapshot when using inferno-compat. Fixes #​1451

v7.1.9

Compare Source

Inferno core

  • Changed opencollective script to use opencollective-postinstall package to reduce inferno package size #​1450

v7.1.8

Compare Source

Inferno core

  • Fixes an issue where vNode key could change after multiple normalizations #​1447

v7.1.7

Compare Source

All packages

Fixes an issue where not all typing information was published to npm

  • versions 7.1.3 - 7.1.6 skipped due to this error

v7.1.6

Compare Source

v7.1.5

Compare Source

v7.1.4

Compare Source

v7.1.3

Compare Source

v7.1.2

Compare Source

Inferno core

  • Moved isPropagationStopped & isDefaultPrevented methods from inferno-compat to inferno-core synthetic events only. This fixes compatibility issue between inferno-compat and video.js - e6666bd

Inferno router

  • Fixes an issue where Switch component did not render nested-array children correctly #​1441

v7.1.1

Compare Source

Inferno core

  • Optimizes LIS algorithm performance #​1438

v7.1.0

Compare Source

Inferno core

  • Non synthetic events are now using addEventListener API instead of directly assigning event callbacks to html node. This adds support for events which have non standard inline API for example: transitionend
    https://developer.mozilla.org/en-US/docs/Web/Events/transitionend
  • Fixes a bug where forwardRef -Component got wrong ref parmeter during patch. #​1436
  • Adds support for selectIndex -property for select elements. #​1425
  • All internal dependencies updated and minor code clean up

v7.0.5

Compare Source

Typescript

  • Fixes an issue where Functional component props.children was not assignable to JSX node #​1428

Internal

  • Dependencies updated
  • Typo fixed in Readme #​1427

v7.0.4

Compare Source

Inferno core

  • This release fixes an issue where vNode tree might get re-mounted when VNode is passed as reference. #​1426
  • Internal development dependencies updated

v7.0.2

Compare Source

Inferno core

  • Fixes an issue caused by Inferno 7.0.1 when vNode's were passed to multiple locations in the vNode tree rendered incorrectly.
  • Updated to babel 7.2

v7.0.1

Compare Source

Inferno core

  • Fixes typescript issue where Component was not assignable as IComponentConstructor #​1422
  • Small code clean up

v7.0.0

Compare Source

Inferno core

This release changes how inferno queues setState calls. In earlier versions (v6 and before) Inferno used Component's instance to keep track of its updating state. However this pattern failed when child component called parent method or raised an event which lead parent to do setState during child's update lifecycle.

This has been fixed by moving update detection outside Component instance. Because of this change, setState calls will get more aggressively put into the micro task queue. This is a breaking change for applications which expected setState to render synchronously.

If your application code depends on the changed state, you can use setState callback to track when state has changed. Or if synchronous execution is necessary, you can call rerender() method which flushes all pending setState calls. This method should be generally avoided because it can cause infinite loops. It is useful for example in testing purposes to avoid setTimeout.

Due to this change version has been increased to 7.

v6.3.1

Compare Source

Inferno core

  • Fixes an issue where Fragment appended its content outside its boundary #​1421
  • Fixes an issue where optimized Fragments $HasKeyedChildren / $HasNonKeyedChildren failed for empty content

v6.3.0

Compare Source

Inferno core

  • Fixes an issue where setState function gets wrong state argument #​1420
  • Optimized rendering count when setState is called multiple times

v6.2.1

Compare Source

Inferno SSR

  • Fix error in SSR "Node is not defined" when JSDom is not available

v6.2.0

Compare Source

Inferno core

This release does small improvement to runtime performance on V8 and code clean up

  • Fixed v8 de-optimization "not enough type information..." in patchChildren method
  • Fixed issue where v8 was de-opting during event delegation handling reason "wrong map"
  • Fixed issue where linkEvent methods were always re-attached

JSX plugin (babel-plugin-inferno v6.0.3)

  • Added new option defineAllArguments it can be used to work around V8 Builtin:ArgumentsAdaptorTrampoline this comes with a cost of bundle size increase. Disabled by default

v6.1.5

Compare Source

Inferno core

Fixes an issue where setState callback was not called after queuing multiple setStates

v6.1.4

Compare Source

Inferno core

Fixes an issue where patching SVG properties failed when component was inside SVG dom. #​1415

v6.1.3

Compare Source

Inferno core

Fixes an issue where Fragment children rendered to wrong place in DOM when fragments last children was component with another fragment root

v6.1.2

Compare Source

Inferno core

Fixes an issue where emptying Fragment root inside another Fragment caused its new children to be mounted outside its boundaries. #​1412

Typescript

Adds back native event properties to following events: ClipboardEvent, CompositionEvent, DragEvent and FocusEvent #​1411 a4b7b50

v6.1.1

Compare Source

Inferno-test-utils

  • Fixes an issue where text nodes were not correctly rendered using method renderVNodeToSnapshot #​1404

Typescript

  • Fixes typescript compilation error in types.ts file #​1407
  • Improves create-element typing #​1408

v6.1.0

Compare Source

Inferno core

Fixes bug where multiple calls to setState caused setState callbacks to trigger wrong time

Inferno-test-utils

Fixes issue where renderToSnapshot did not correctly render root level Fragments #​1404

Typescript

Fixes type information in inferno-create-element method, children parameter d7abde6

v6.0.3

Compare Source

Inferno core

  • Fixes bug where rendering single Fragment inside another Fragment didn't create DOM #​1399

v6.0.2

Compare Source

Inferno core

  • Fixes an issue where select - option elements were not correctly selected when option tags were inside another component #​1400
  • Fixes an issue where replacing single fragment root with multiple fragments didn't remove all dom nodes

v6.0.1

Compare Source

Fixes error in environments where document is not available

v6.0.0

Compare Source

InfernoJS v6.0.0

Breaking changes

  • hydrate moved to inferno-hydrate package
  • Style properties use hyphen syntax backgroundColor => background-color
  • JSX plugin depends on babel v7
  • Lifecycle changed to have better compatibility with ReactJS
  • String refs completely removed

For complete list see Migration guide

New features

  • Fragments, a new type of VNode that can be used to render Component root level arrays
  • createRef API
  • forwardRef API
  • new Component lifecycle: getDerivedStateFromProps and getSnapshotBeforeUpdate
  • $HasTextChildren new JSX compilation time optimization flag added
  • rerender method
  • top level context
Fragments

Fragment support means you can return array from Component render creating an invisible layer that ties its content together
but will not render any container to actual DOM. The examples below need v6 babel-plugin-inferno

Short syntax example <> ... </>

import { Component } from 'inferno';

class MyApplication extends Component {

    render() {

        /*
         * This will render "<span>Hi</span><div>Okay</div>"
         * to location where MyApplication is used
         * /
        return (
            <>
                <span>Hi</span>
                <div>Okay</div>
            </>
        )
    }
}

Long syntax allows you to specify keys for Fragments. This is useful if there are many Fragments or if array is built dynamically.

import { Component, Fragment } from 'inferno';

class MyApplication extends Component {

    render() {

        const list = [];

        if (/* some logic */) {
            list.push(
                <Fragment key="coffee">
                    <dt>Coffee</dt>
                    <dd>Black hot drink</dd>
                </Fragment/>
            );
        }

        ...

        if (/* other logic */) {
            list.push(
                <Fragment key="milk">
                    <dt>Milk</dt>
                    <dd>White cold drink</dd>
                </Fragment/>
            );
        }

        /*
         * This will render
         * <dl>
         *    <dt>Coffee</dt>
         *    <dd>Black hot drink</dd>
         *    <dt>Milk</dt>
         *    <dd>White cold drink</dd>
         * </dl>
         * /
        return (
            <dl>
                {list}
            </dl>
        )
    }
}

You can create fragment:

  • Using native Inferno API createFragment(children: any, childFlags: ChildFlags, key?: string | number | null)
  • Using JSX <> ... </>, <Fragment> .... </Fragment> or <Inferno.Fragment> ... </Inferno.Fragment>
  • Using createElement API createElement(Inferno.Fragment, {key: 'test'}, ...children)
  • Using hyperscript API h(Inferno.Fragment, {key: 'test'}, children)

React documentation: https://reactjs.org/docs/fragments.html

CreateRef API

createRef method allows nicer syntax, and reduces code when no callback to DOM creation is needed.
The below example creates ref object and stores it to Component property element.
This object is then assigned to the element where you want to create reference. In the example below we want to reference "span".
After render has gone, span element is available in this.element.current property.

import { Component, render, createRef } from 'inferno';

class Foobar extends Component {
  constructor(props) {
    super(props);

    // Store reference somewhere
    this.element = createRef(); // Returns object {current: null}
  }

  render() {
    return (
      <div>
        <span id="span" ref={this.element}>
          Ok
        </span>
      </div>
    );
  }
}

render(<Foobar />, container);

React documentation: https://reactjs.org/docs/refs-and-the-dom.html

ForwardRef API

forwardRef is a new mechanism to "forward" ref inside a functional Component.
It can be useful if you have simple functional Components and you want to create reference to a specific element inside it.

import { forwardRef, Component, render } from 'inferno';

const FancyButton = forwardRef((props, ref) => (
  <button ref={ref} className="FancyButton">
    {props.children}
  </button>
));

class Hello extends Component {
  render() {
    return (
      <FancyButton
        ref={btn => {
          if (btn) {
            // btn variable is the button rendered from FancyButton
          }
        }}
      >
        Click me!
      </FancyButton>
    );
  }
}

render(<Hello />, container);

React documentation: https://reactjs.org/docs/forwarding-refs.html

New lifecycle

Like in React when new lifecycle methods getDerivedStateFromProps or getSnapshotBeforeUpdate are used old lifecycle methods will not be called ( componentWillMount, componentWillReceiveProps componentWillUpdate ).
There will not be UNSAFE_ methods in Inferno. Just use the normal names.

TextChildren

New optimization paths have been added for text. JSX users can force this optimization by adding $HasTextChildren tag to any vNode element.
This makes given element always render text. Normalization will also default into text children when only single text element is detected as children.

This flag also simplifies an old version of:

import { createTextVNode } from 'inferno';

// While this still works, this is not recommended anymore
<div $HasVNodeChildren>{createTextVNode('text')}</div>

New version:

// No imports needed
<div $HasTextChildren>text</div>
rerender

rerender is a new method that will flush all pending setState calls and render immediately.
It can be used when render timing is important, or to simplify tests.

import { Component, rerender, render } from 'inferno';

describe('test example', () => {
    it('Should update immediately', () => {
      class Foo extends Component {
        constructor(props, context) {
          super(props, context);

          this.state = {
            value: 'initial'
          };
        }

        componentDidMount() {
          this.setState({ value: 'updated' });
        }

        render() {
          return <div className={this.state.value} />;
        }
      }

      const container = document.createElement('div');

      render(<Foo />, container);
      expect(container.firstChild.className).toEqual('initial');

      // Call rerender to flush pending setState, no timeouts needed
      rerender();
      expect(container.firstChild.className).toEqual('updated');
    });
});
Top level context

Inferno.render now takes fourth parameter which is initial context.
This removes the need of wrapping application with Class component.

import { render } from 'inferno';

function App (props, context) {
    // context contains property "foo" => "bar"

    return <div>Cool App!</div>;
}

render(<App />, document.getElementById('root'), callback, { foo: 'bar' });

Common

Runtime memory usage has been improved. dom properties are no longer stored to component vNode.
Various properties have been removed from ES6 Component as well. parentVNode hack has been removed removing circular
references from vNode tree. Normalization array['$'] = true hack has been removed.

Core
  • Better recovery from user land errors
  • Fixes performance issue where normalization copied input data two times
  • Fixes performance issue where frozen input data was always copied
Typescript
  • Adds support for pointer event types
  • setState typings have been improved. #​1388
Inferno-router
  • Improved nested routes handling #​1360
  • Route component can now have multiple children
Inferno-compat
  • options.reactStyles option added, setting it false removes runtime transformation of style properties

List of Github issues can be found using this link: https://github.com/infernojs/inferno/issues?utf8=%E2%9C%93&q=label%3A%22Fixed+in+v6.0.0%22+

v5.6.1

Compare Source

Inferno-test-utils

  • Fixes an issue where className was not rendered correctly using renderToSnapshot
  • Fixes an issue where nested vNode tree was not fully rendered using renderToSnapshot

Inferno-extras

This is new package that contains helper utilities to work with InfernoJS virtual DOM. The first methods are:

isDOMinsideVNode(htmlNode, vNode) - returns true when htmlNode is found from the sub tree of vNode
isDOMinsideComponent(htmlNode, instance) - returns true when htmlNode is found from rendered virtual node tree of component instance

Read more about inferno-extras here

v5.6.0

Compare Source

All packages

  • Fixes an issue where typescript object rest spread was compiled to Object.assign which failed in IE 11 and below.
  • There is now a not-transformed bundle available in {pkg}/dist/index.esnext.js

Inferno-router

Fixed server side rendering example #​1347

v5.5.0

Compare Source

Typescript

  • All Inferno types are now included within the library. #​1377
  • Inferno modules are now compiled using noUnusedParameter: true

Inferno-mobx

  • Removed "undefined" from mobx logger. #​1379

Inferno-create-class

  • Fixes an issue where prototype methods were ignored #​1380

Internal

  • Updated to Babel 7 to prepare for Fragments
  • Updated to Lerna 3
  • Removed dts-bundle module its no longer used

v5.4.2

Compare Source

Inferno-core

This release fixes an issue where application level error caused further rendering to get stuck

v5.4.1

Compare Source

Typescript support

Inferno now builds types using outputAsModuleFolder: true to fix Webstorm IDE intellisense and to have better compatibility between node module system.

v5.4.0

Compare Source

Inferno-core

  • Always diff through whole vNode tree, even when vNodes are strictly equal. Fixes #​1369 #​1345
  • Improves performance when no contenteditable elements are used. JSX users update to babel-plugin-inferno v5.1.0
  • Adds basic support for content-editable elements. Nested html is not supported for content-editable elements, only text for now. Fixes #​1186

Inferno-server

Inferno-compat

  • Fixes an issue where props were removed when cloning vNodes multiple times

Inferno-test-utils

  • Fixes typescript type reference error #​1366

Common

  • New version of prettier ran on whole project
  • All dependencies updated

Documentation

  • Inferno-mobx inject documentation updated #​1368
  • Link changed to round 7 web framework benchmark #​1372
  • Rollup config updated #​1367
  • Removed functional component work around from Inferno router examples

Babel-plugin-inferno v5.1.0

v5.3.0

Compare Source

Improved error recovery

This release adds basic support for recovering from user-land errors. Previous render result is now changed as diffing process goes on. When an exception happens, next render continues from the correct state.

Inferno-core

Chaining forceUpdate now renders asynchronously ( the same way as setState ) to avoid error situations

v5.2.0

Compare Source

Inferno-core

Fixes issue where Inferno's synthetic events blocked Firefox mid click #6b4abe7

Typescript support

onDoubleClick type has been renamed to onDblClick to match inferno events 15a2196
Fixes typescript error when using Route component from inferno-router e649417

Inferno-redux

Exposed wrapActionCreators method

Maintenance

Dependencies updated

v5.1.1

Compare Source

Inferno-devtools

  • Fixes issue where devtool children and inferno children ran out of sync
  • Fixes issue where devtool root components got same unique key

v5.1.0

Compare Source

Inferno-core

  • Added documentation about tear downing Inferno application ( 5051e12 )
  • Added guard for chaining forceUpdate into setState which caused runtime error
  • Cleaned lifecycle parameter from all methods ( a647ac0 )
  • Simplified autofocus attribute handling ( 9a23d67 )
  • options.roots has been removed to reduce memory usage
  • options.afterMount / options.afterUpdate / options.beforeUnmount has been removed as they are no longer needed for devtools

Inferno-devtools (React developer tools)

Inferno - React developer tools integration has been rewritten from scratch. It no longer wraps functional Components into Class Components, it now correctly updates state / and props where possible and no longer duplicates root nodes. This rewrite also fixes some long running issues about the devtools. ( #​729 #​677 #​1326 #​1324 )

You can get React developer tools for Chrome from Chrome store

Inferno-router

  • Documentation has been updated
  • Fixed Navlink component adding exact attribute to DOM

Typescript

  • Added non synthetic events to Inferno JSX types ( 641cf8a )
  • Allow JSX node to be Router children ( 11171f7 )

Build & Maintenance

  • Minimized console logs during Travis CI tests
  • All dependencies updated

v5.0.6

Compare Source

Inferno-core

Adds support for boolean expressions in children types TSX (Typescript JSX)
Adds support for style property as string #​1338

v5.0.5

Compare Source

Inferno-core

Better typescript support across the library, fixes Github #​1332
Fixes Maximum callstack size exceeded error when using AngularJS and inspire-tree-dom with Inferno #​1331

Internal

All dependencies updated
Travis moved to NodeJS 10

v5.0.4

Compare Source

Inferno-core

Improved keyed patch runtime performance by keeping "Sources" variable type "PACKED_SMI_ELEMENTS" v8 e6799c6

Inferno-clone-vnode

Fixes bug where cloning text vNode it did not honor children argument. #​1330


Renovate configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻️ Rebasing: Whenever PR becomes conflicted, or if you modify the PR title to begin with "rebase!".

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

Newsflash: Renovate has joined WhiteSource, and is now free for all use. Learn more or view updated terms and privacy policies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant