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

chore: update dependency inferno-test-utils to v9 #934

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

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jan 27, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
inferno-test-utils (source) ~5.6.2 -> ~9.0.0 age adoption passing confidence

Release Notes

infernojs/inferno (inferno-test-utils)

v9.0.1

Compare Source

inferno-core

v9.0.0

Compare Source

Inferno v9.0.0

This is maintenance release. it drops support for old browser versions including IE and removes old coding patterns.
InfernoJs source code has been modernized to support latest versions of tooling.

Breaking changes

inferno-create-class has been removed, use createComponentVNode, createElement APIs instead.
If you were using createClass to wrap the class into observable you can do the same by extending inferno component.

observer(
  class MyCom extends Component {
    componentWillReact() {
      willReactCount++;
    }

    render() {
      return (
        <div id="x">
          {[foo.a.get(), foo.b.get(), foo.c.get()].join(',')}
        </div>
      );
    }
  },
);

Inferno v9 requires following features to be present in the executing runtime:

  • Promise
  • String.prototype.includes()
  • String.prototype.startsWith()
  • Array.prototype.includes()
  • Object.spread()

options.componentComparator has been removed
options.renderComplete has been removed, same result can be achieved by calling own function after render

ES module bundle extension is now .mjs

inferno.esnext.js bundle has been removed and replaced with inferno.mjs bundle.
The following bundles have been renamed:

inferno.esm.js is now inferno.mjs

inferno.dev.esm.js is now inferno.dev.mjs

You may need to change how you are loading inferno dev & production bundles.
for example Webpack config:

...
    resolve : {
        alias: {
            'inferno': isProduction ? 'inferno/dist/index.mjs' : 'inferno/dist/index.dev.mjs',
        }
    },
....
Inferno-core
Inferno-router
  • path-to-regexp-es6 changed to path-to-regexp to include recent bugfixes and address security vulnerability
Inferno-server
Announcing swc-plugin-inferno

swc-plugin-inferno plugin can compile JSX and TSX syntax for inferno specific virtual nodes. It offers improved compilation time compared to existing plugins. In addition it has access to typescript type information which can be used in future for optimizations and new features.

Below chart compares compilation time of inferno repository tests using different compilers.

image

Inferno now supports Eslint v9
Starter template update

The following repository has been updated to create a reference how to use inferno with latest tech including:

Inferno v9
Webpack v5
Typescript v5
SWC v1 see [swc-plugin-inferno](https://redirect.github.com/infernojs/swc-plugin-inferno)
Tailwind v4
PostCSS v8
Eslint v9

https://github.com/infernojs/inferno-swc-example

v8.2.3

Compare Source

Inferno-core

Inferno-router

v8.2.2

Compare Source

Inferno-Router

  • Fixes Uncaught TypeError: e is not a function call error in <Prompt/> component by adapting to a new history blocking API infernojs/inferno@68213f0

Internal

  • Internal dependencies have been updated

v8.2.1

Compare Source

Inferno v8.2.1

Inferno core
  • Fixes an issue where type ComponenType<P> was not assignable to parameter "type" of createComponentVNode method infernojs/inferno@4bc0268

v8.2.0

Compare Source

Inferno v8.2.0

Inferno router
Internal
  • Internal dependencies have been updated
  • Jasmine updated to v5 and lowest testing target of FireFox browser is now v91 due to limited browser support in latest version of jasmine

v8.1.1

Compare Source

Typescript

  • added types for inline CSS variables
  • added types for SVG attributes in native format
  • added types for indeterminate and for native attributes

Internal

v8.1.0: Inferno v8.1.0

Compare Source

Typescript

  • Breaking change Inferno.JSX.Element type has been removed in favor of more correct automatic typing
    • InfernoNode and InfernoNodeSingle has been added as top level exports to inferno package.
    • InfernoNode can be used as a replacement for Inferno.JSX.Element for type checking "any" JSX entry
    • InfernoNodeSingle can be used to restrict Component children to a single JSX node ( excluding arrays )
      This fixeshttps://github.com/infernojs/inferno/issues/1630ues/1630
  • $ReCreate attribute has been added to allowed TSX attributes
  • selectedIndex property has been added to allowed select attributes
  • type Key has been unified and moved as top level export of inferno package
  • math formula elements are now allowed in TSX
  • Typescript has been upgraded to v5
  • media element is now correctly typed in TSX

Inferno-vnode-flags

  • 0 is now reserved for unknown value

Internal

  • all inferno package tests has been converted to TSX
  • development dependencies updated

v8.0.6: Inferno v8.0.6

Compare Source

Typescript

Inferno

  • Internal dependencies updated

v8.0.5: Inferno v8.0.5

Compare Source

Typescript

Inferno router

v8.0.4

Compare Source

Typescript

Internal

  • Dependencies updated to latest versions
  • Rollup plugin bubble replaced with babel

v8.0.3: Inferno v8.0.3

Compare Source

Inferno-core

Typescript

Dependencies

v8.0.2: Inferno v8.0.2

Compare Source

Typescript

  • Reverted Component state from read-only to mutable object
  • inferno-router typings improved
  • type IComponentConstructor removed it was not needed for anything

v8.0.1: Inferno v8.0.1

Compare Source

Typescript

v8.0.0: Inferno v8.0.0

Compare Source

Inferno

Typescript

Inferno-animation

Special thanks for improving inferno animations to @​jhsware

Inferno-router

  • history package has been updated to version 5

Inferno-mobx

Special thanks for improving inferno-mobx to @​Gwenio

Build system and internal changes

Breaking changes

v7.4.11: Inferno v7.4.11

Compare Source

v7.4.10: Inferno v7.4.10

Compare Source

All packages

This release fixes a possible supply chain attack by adding repository link to all packages https://github.com/infernojs/inferno/pull/1574

v7.4.9: Inferno v7.4.9

Compare Source

Inferno-core

Inferno-router

v7.4.8: Inferno v7.4.8

Compare Source

Inferno core

Fixes an issue where shouldComponentUpdate gets called after forceUpdate if there were pending state changes on the given component https://github.com/infernojs/inferno/issues/1534 https://github.com/infernojs/inferno/pull/1535
Inernal dependencies updated

v7.4.7: Inferno v7.4.7

Compare Source

Inferno-core

This release fixes wrong "latest" tag in npm registry after v5 hotfix
Internal dependencies updated infernojs/inferno@90e2daa
License year updated infernojs/inferno@1f06cdd

v7.4.6: Inferno v7.4.6

Compare Source

Inferno all packages

This release fixes broken UMD bundle header in all packages https://github.com/infernojs/inferno/issues/1527

v7.4.5: Inferno v7.4.5

Compare Source

Inferno-core

Improved createRef() type

Inferno-server

Fixes a bug where rendering forwardRef component server side failed to exception. https://github.com/infernojs/inferno/issues/1523

v7.4.4: Inferno v7.4.4

Compare Source

Inferno-router

Navlink component typescript typings have been improved and it does not require all properties to be set anymore. This fixes Github issue https://github.com/infernojs/inferno/issues/1518

Internal dependencies were updated

v7.4.3: Inferno v7.4.3

Compare Source

Inferno core

Optimized rendering functional component infernojs/inferno@1af165f
Optimized cloneFragment method infernojs/inferno@85eba12

Internal development dependencies have been upgraded

v7.4.2: Inferno v7.4.2

Compare Source

Inferno core

Fixes an issue introduced in v7.4.1 where setState callback was called even if component got unmounted infernojs/inferno@0e6b243

v7.4.1: Inferno v7.4.1

Compare Source

Inferno core

Fixes an issue where all setState callbacks were not called after chaining multiple setStates during asynchronous flow

Inferno router

Fixes typings of IRouteProps component infernojs/inferno@078b323

v7.4.0: Inferno v7.4.0

Compare Source

Inferno-server

Inferno-compat

v7.3.3: 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: Inferno v7.3.2

Compare Source

Inferno core

v7.3.1: Inferno v7.3.1

Compare Source

Inferno-hydration

v7.3.0: Inferno v7.3.0

Compare Source

Inferno-core

v7.2.1: Inferno v7.2.1

Compare Source

Inferno-core

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

v7.2.0: Inferno 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: Inferno v7.1.13

Compare Source

Inferno-core

Inferno-devtools

v7.1.12: Inferno 7.1.12

Compare Source

Inferno core

v7.1.11: Inferno 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: Inferno v7.1.10

Compare Source

Inferno-test-utils

Removed props.children from snapshot when using inferno-compat. Fixes https://github.com/infernojs/inferno/issues/1451

v7.1.9: Inferno v7.1.9

Compare Source

Inferno core

v7.1.8: Inferno v7.1.8

Compare Source

Inferno core

v7.1.7: Inferno 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: Inferno 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 - infernojs/inferno@e6666bd

Inferno router

v7.1.1: Inferno v7.1.1

Compare Source

Inferno core

v7.1.0: Inferno v7.1.0

Compare Source

Inferno core

v7.0.5: Inferno v7.0.5

Compare Source

Typescript
Internal

v7.0.4: Inferno v7.0.4

Compare Source

Inferno core

v7.0.2: Inferno 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: Inferno v7.0.1

Compare Source

Inferno core

v7.0.0: Inferno 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: Inferno v6.3.1

Compare Source

Inferno core

v6.3.0: Inferno v6.3.0

Compare Source

Inferno core

v6.2.1: Inferno v6.2.1

Compare Source

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

v6.2.0: Inferno 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: Inferno v6.1.5

Compare Source

Inferno core

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

v6.1.4: Inferno v6.1.4

Compare Source

Inferno core

Fixes an issue where patching SVG properties failed when component was inside SVG dom. https://github.com/infernojs/inferno/issues/1415

v6.1.3: Inferno 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: Inferno 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. https://github.com/infernojs/inferno/issues/1412

Typescript

Adds back native event properties to following events: ClipboardEvent, CompositionEvent, DragEvent and FocusEvent https://github.com/infernojs/inferno/issues/1411 infernojs/inferno@a4b7b50

v6.1.1: Inferno v6.1.1

Compare Source

Inferno-test-utils
Typescript

v6.1.0: Inferno 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 https://github.com/infernojs/inferno/issues/1404

Typescript

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

v6.0.3: Inferno v6.0.3

Compare Source

Inferno core

v6.0.2: Inferno 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 https://github.com/infernojs/inferno/issues/1400
  • Fixes an issue where replacing single fragment root with multiple fragments didn't remove all dom nodes

v6.0.1: Inferno v6.0.1

Compare Source

Fixes error in environments where document is not available

v6.0.0: Inferno 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
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+


Configuration

📅 Schedule: Branch creation - "after 10pm,before 5:00am" (UTC), Automerge - At any time (no schedule defined).

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

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 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

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies Updates a dependency label Jan 27, 2025
@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Updates a dependency needs review Review pending
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants