v9.0.0
Deprecations
@lwc/engine-serveris deprecated and won't receive further updates. Consumers should update their code to use the replacement,@lwc/ssr-runtime.
Breaking Changes
- The
mainexport of each package is now ESM, rather than CommonJS.- Beginning with v9.0.3, for compatibility purposes a CJS bundle is published for each package in
dist/index.cjs.
- Beginning with v9.0.3, for compatibility purposes a CJS bundle is published for each package in
- The
experimentalDynamicComponentoption in@lwc/compileris renamed todynamicImports, and is no longer experimental. @lwc/babel-plugin-componentno longer performs import deduplication, as rollup provides the same functionality.- This is not a breaking change for consumers of
@lwc/rollup-pluginor components on the Salesforce platform. It only impacts direct consumers of@lwc/babel-plugin-componentor@lwc/compiler.
- This is not a breaking change for consumers of
- The type definition for wire decorators is updated. The
wirefunction now has three type parameters, rather than four. TheContextparameter was not necessary, and has been removed. Additionally, invalid@wireusage now reports errors in the correct location. Some edge cases can result in false positive errors or false negatives.- Reactive properties in configs are type checked, but reactive property chains are not. For example,
{id: "$bookId"}will be type checked, but{id: "$book.id"}will not (it will always be permitted). - Config values typed as
stringcannot provide type checking for reactive properties. For example,{str: "$notString"}will be permitted, even ifnotStringis not a string property on the component. - To avoid unnecessarily large type unions, only objects can be used at the top level of a property chain. This excludes valid edge cases, like
"$myString.length". - To avoid unnecessarily large type unions, properties from
LightningElementare excluded. This excludes valid edge cases, like"$hostElement.childElementCount". - To avoid false positive errors, use a getter prop or a type assertion, such as
"$myObj.myProp" as Component["myObj"]["myProp"]. - For full details, view the pull request that introduced the change.
- Reactive properties in configs are type checked, but reactive property chains are not. For example,
Other Changes
- Packages now leverage
engines.nodeto warn when using old versions of Node.js. The officially supported Node.js versions remain the LTS releases, currently v22 and v24. - Type definitions are now published using TypeScript v6.
- All imports from Node's built-in modules now use the
node:protocol.
Commits
- test(wtr): refine exception cases to match updated behavior by @wjhsf in #5694
- build(deps-dev): bump prettier from 3.8.0 to 3.8.1 in the lint group by @dependabot[bot] in #5690
- build(deps): bump fast-xml-parser from 5.3.1 to 5.3.4 by @dependabot[bot] in #5693
- chore: release LWC v9 by @wjhsf in #5635
Full Changelog: v8.28.2...v9.0.0