Repository navigation
chore: update dependency babel-plugin-inferno to v10 - #110
Closed
renovate[bot] wants to merge 1 commit into
Closed
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Plugin v10 is incompatible with the existing Babel 7 and Inferno 5 dependencies.
1 open finding
What changed in this PR
Updates the Inferno Babel plugin from v5 to v10.
Changes:
- Bumps
babel-plugin-inferno. - Refreshes transitive dependencies and lock data.
| File | Description |
|---|---|
| package.json | Updates the plugin dependency. |
| package-lock.json | Records the updated dependency tree. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "@babel/preset-env": "^7.29.7", | ||
| "babel-loader": "^10.1.1", | ||
| "babel-plugin-inferno": "^5.1.0", | ||
| "babel-plugin-inferno": "^10.0.0", |
Contributor
Author
Renovate Ignore NotificationBecause you closed this PR without merging, Renovate will ignore this update. You will not get PRs for any future If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR contains the following updates:
^5.1.0→^10.0.0Release Notes
trueadm/babel-plugin-inferno (babel-plugin-inferno)
v10.0.0Compare Source
10.0.0
This release compiles JSX for Inferno 10. The plugin now calls Inferno 10's
newVNodefactories, which take the shape of the children inside the vNode flags. It also removes$ReCreate, and it stops the build when a child flag cannot match the children it is written on.From this release on, the major version of the plugin matches the major version of Inferno: use plugin 10.x with Inferno 10.x, plugin 11.x with Inferno 11.x, and so on. There is no plugin 8 or 9. For Inferno 9 and older, keep using plugin 7.
Breaking changes
Inferno 10 is required
The compiled code calls the Inferno 10 factories:
createVNodenewVNodecreateComponentVNodenewComponentVNodecreateFragmentnewFragmentcreateTextVNodenewTextVNodenormalizePropsis unchanged.The child flags are no longer a separate argument. Each vNode gets one number that holds both its type and the shape of its children, using the
VNodeFlagsofinferno-vnode-flags10. Inferno 10 also renumbered these flags, so code compiled by plugin 7 does not work with Inferno 10 and has to be compiled again. This includes packages that ship JSX compiled by plugin 7.Children that are only known at runtime, such as
{expression}, get no child bit, and Inferno normalizes them. Components getComponentUnknown, which is now 0. The README lists all the flag values.$Flagstakes Inferno 10 flag values$Flags={expression}still replaces the flags of the vNode. The value is now read as Inferno 10VNodeFlags, and the plugin adds the child bit of the children to it. Components also getHasInvalidChildren(16). Update any numbers you pass. For example,$Flags={64}meantInputElementin plugin 7 and meansSvgElementin plugin 10.HtmlElementComponentUnknownComponentClassComponentFunctionSvgElementInputElementTextareaElementSelectElementContentEditable$ChildFlagkeeps theChildFlagsvalues: 0, 1, 2, 4, 8 and 16.$ReCreateis removedInferno 10 has no ReCreate flag. The plugin throws for
$ReCreateon any element, component or Fragment, whatever theuselessFlagsoption is. To re-create an element, change its key instead. Inferno unmounts the old element and mounts a new one when the key changes.Child flags that cannot match the children are compile errors
When the JSX shows that the children cannot have the shape a child flag declares, the plugin now throws an error that points at the flag. Before, the plugin ignored the flag or passed it on to Inferno, which then rendered the children wrong or threw in development.
Dynamic children such as
{expression}are not checked, and neither are the children of components. TheuselessFlagsoption does not turn this check off.A
refwithout a value is a compile error<div ref />compiled to atrueref, which is neither a callback nor a ref object. Give the ref an explicit value.The
pragmaoptions rename the Inferno 10 factoriespragma,pragmaCreateComponentVNode,pragmaFragmentVNodeandpragmaTextVNodenow replacenewVNode,newComponentVNode,newFragmentandnewTextVNode. A custom function set with these options gets the new arguments:newVNode(flags, type, className, children, props, key, ref)has nochildFlagsargument, andnewFragment(flags, children, key)takes the flags first.Changes
$ChildFlag$ChildFlagis folded into the flags like the other child flags.<div $ChildFlag={2}>{a}</div>compiles tonewVNode(9, "div", null, a).$ChildFlagexpression is only known at runtime, so that element or Fragment is compiled to Inferno's deprecatedcreateVNodeorcreateFragment, which convert the value. The plugin imports them next to the new factories when they are needed. These two calls do not use thepragmaoptions.Smaller output
nullvalues ofclassName,key,refandchildrenare left out.<div className={null} key={null} ref={null} />compiled tocreateVNode(1, "div", null, null, 1, null, null, null)and now compiles tonewVNode(17, "div"). Other props keep theirnullvalues.{null}child is left out too.<Fragment>{null}</Fragment>compiles like an empty Fragment:newFragment(272).Bug fixes
$ChildFlagwas put in an array.<Fragment $ChildFlag={x}>{a}</Fragment>compiled tocreateFragment([a], x), so the flag described the array instead of the value. The child is now passed as written:createFragment(a, x). Static children are still put in an array.Development
$ReCreateand valueless refs.$ReCreate.inferno10 is added as a dev dependency.Upgrading
infernoandbabel-plugin-infernoto 10 together, and follow the Inferno 10 migration guide.$ReCreatewith a changingkey.refa value.$Flagsto the Inferno 10 values, and update custompragmafunctions to the new arguments.v7.1.0Compare Source
7.1.0
This release warns about optimization flags that cannot change the compiled output, fixes Fragments that combine child flags with dynamic or
childrenprop content, and makes source maps point at tag names.New features
Useless flag warnings (#60)
The plugin now warns when a compile-time flag cannot improve the output:
{expression}orchildren={expression}.props.children, so the flag does nothing.$ChildFlag,$HasKeyedChildren,$HasNonKeyedChildren,$HasTextChildren,$HasVNodeChildren.$ReCreatetogether with$Flags.$Flagsreplaces all the vNode flags, including ReCreate.$Flagsor$ReCreateon a Fragment. Fragments have no vNode flags.The warning is printed with
console.warnand shows the file, line, column, the reason and a code frame:New
uselessFlagsoption"warn"(default): print a warning."error": stop the build at the first useless flag. For example, CIlags out."off": do nothing.Any other value fails when Babel loads the config, so a typo does not The README shows how to use a different level in CI or in some folders.
Bug fixes
Fragments with child flags and
childrenprops<Fragment $HasTextChildren>{x}</Fragment>and<Fragment $HasTextCped the child and compiled to an emptycreateFragment(). They nowcompile tocreateFragment([createTextVNode(x)], 4)`.<Fragment $HasTextChildren><a /></Fragment>crashed the plugin witrayExpression expected node ... but instead got undefined, and{}` was dropped. JSX children now stay vNodes whatever the flag says.<Fragment $HasVNodeChildren>{x}</Fragment>passed the single childnflag (4), which tells Inferno the children are an array. It now usesHasVNodeChildren` (2).<Fragment children="text" key="k" />compiled with theHasInvalidxt was not rendered. It now compiles tocreateFragment([createTextVNode("text")], 4, "k")`.childrenprop combined with a child flag on a Fragment prmatch the flag, such ascreateFragment("text", 8)for$HasKeyedChildren. The text is now always compiled to[createTextVNode("text")].<Fragment children="text" />without a key or flag is now compilede instead of being normalized at runtime.createTextVNodeis imported only when the output calls it. Before,<Fragment $HasTextChildren />and<Fragment $HasTextChildren>{x}{y}</Fragment>imported itwithout using it.
Source maps
<Foo …>maps toFoo:4), the same as Babel's react-jsx transform. Element tags ("div") and each part of a member tag (Ns.Inner.Comp,this.Item,Foo["baroo.Upgrading
Projects that use
$flags may see new warnings in the build output. The warnings do not change the compiled code. Remove the flags the warnings point at, or setuselessFlags: "off".v7.0.0Compare Source
7.0.0
This release fixes many cases where the plugin generated wrong or invalid code, adds compile-time errors for mistakes it used to accept silently, and roughly halves the plugin's own transform cost.
Breaking changes
<p prop prop />, twokeys, tworefs, repeatedonComponent*hooks or$flags.className+class,htmlFor+for,tabIndex+tabindex,strokeWidth+stroke-width,xlinkHref+xlink:href.keywithout a value is now a compile error.<li key />used to compile tokey: true. Give the key an explicit value.Bug fixes
Imports and module output
imports: false: when several files were compiled with the same config (babel-loader,loadOptionsSync), only the first file gotvar createVNode = Inferno.createVNode. Every later file failed at runtime withReferenceError: createVNode is not defined. The plugin no longer keeps state between files.imports: false: that declaration now goes at the top of the file, after the imports and after the file's ownInfernodeclaration. Before, it was inserted just before the first statement that contained JSX, so a hoisted function called earlier in the file ran whilecreateVNodewas still undefined.sourceType: "script", and"unambiguous"on a file withoutimport/export: the plugin added animportdeclaration, which is invalid in a script. It now usesrequire("inferno")there.imports: "true"given as a string was read as a module name. It is now read astrue.Children
<div children={x} />was always compiled as a single vnode (HasVNodeChildren). As a result, strings and arrays passed that way failed Inferno's flag validation in development and broke mounting in production. Now only JSX values are flagged as a single vnode, and Inferno normalizes other values at runtime.<Fragment children={a} />had the same bug.children=<span />(JSX without braces) was silently dropped. It now works.<div>{...items}</div>were silently dropped. They now compile to[...items], the same as TypeScript and esbuild.Props
__proto__prop changed the props object's prototype instead of passing the prop. It is now written as a computed key,{["__proto__"]: x}, so the component receives it as an ordinary prop.refandonComponent*hooks crashed the plugin. They are now merged, and the hooks take precedence.<>...</>fragments ignored thedefineAlloption.String attributes
className, produced invalid JavaScript.pattern="\d{3}"becamed{3}, and"\9"was a syntax error in modules.title="a&b"stayeda&b.SVG attributes
lengthAdjust,xChannelSelectorandyChannelSelectorwere lowercased. SVG attribute names are case-sensitive, so browsers ignored them.fontWidth,maskType,textOverflowandwhiteSpacenow becomefont-width,mask-type,text-overflowandwhite-space.Tag names
<a:b />crashed withpath.replaceWith() a falsy node. They now throw a clear error that points to the tag.<Foo-bar />crashed the plugin. It now compiles as a DOM element.<Foo.bar-baz />crashed the plugin. It now compiles toFoo["bar-baz"].<a-b.c />now reports thata-bis not a valid variable name.Source maps
createVNode,createFragment,createTextVNodeandnormalizePropscalls now have the location of the JSX they replace, so source maps point to the JSX.Performance
transformSyncis about 16% faster and allocates about 14% less. The generated code and source maps are unchanged.StringLiteralhas been deprecated" is no longer printed.Development
bench/:npm run bench,bench:quick,bench:compareandbench:profile. See the README.v6.9.0Compare Source
6.9.0
v6.8.5Compare Source
v6.8.4Compare Source
v6.8.3Compare Source
v6.8.2Compare Source
v6.8.1Compare Source
v6.8.0Compare Source
6.8.0
v6.7.2Compare Source
v6.7.2
v6.7.1Compare Source
v6.7.0Compare Source
v6.6.1Compare Source
v6.6.0Compare Source
v6.5.0Compare Source
v6.4.0Compare Source
v6.3.0: babel-plugin-inferno 6.3.0Compare Source
React.Fragment is now also compiled to inferno createFragment call to ease with project migration
infernojs#56
Internal dependencies updated
v6.2.0: babel-plugin-inferno 6.2.0Compare Source
Small improvement to plugin logic
Internal dependencies updated
v6.1.1Compare Source
v6.1.0Compare Source
v6.0.5Compare Source
v6.0.4Compare Source
v6.0.3Compare Source
v6.0.2Compare Source
v6.0.1Compare Source
v6.0.0Compare Source
Configuration
📅 Schedule: (UTC)
🚦 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.
This PR was generated by Mend Renovate. View the repository job log.