Skip to content

Releases: salesforce/lwc

v3.0.2

14 Jul 18:32
c7700bb
Compare
Choose a tag to compare

What's Changed

  • chore: add injection points for devtools instrumentation by @divmain in #3613
  • fix: drop compat code for legacy browsers by @nolanlawson in #3610
  • chore: type safe template references by @ekashida in #3620
  • fix: warn only once about deprecated compiler option enableLwcSpread by @seckardt in #3622

New Contributors

Full Changelog: v3.0.1...v3.0.2

v3.0.1

07 Jul 23:41
e93fd75
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.0.0...v3.0.1

v3.0.0

27 Jun 20:35
5799575
Compare
Choose a tag to compare

LWC v3.0.0 contains breaking changes. Please read carefully below if you are upgrading from v2 to v3.

ℹ️ LWC v3 corresponds to Salesforce release Winter '24 (API version 59).

Breaking Changes

Remove support for IE11 and other legacy browsers

ℹ️ This change applies to all LWC components and the entire Salesforce Lightning platform.

Internet Explorer is no longer supported. If you are using the Salesforce Lightning platform, please refer to Supported Browsers and Devices for Lightning Experience and Ending Support for IE11 on the Lightning Platform.

CSS scope tokens have changed

ℹ️ On the Salesforce Lightning platform, this change only applies to components with an API version of 59 or above.

To scope CSS, LWC automatically adds attributes and classes to DOM elements. These attributes and classes should be considered internal implementation details of the framework, and developers should not rely on them.

In this release, the scope tokens have changed. Before, they used a format like c-foo_foo (for the <c-foo> component). Now, they use a format like lwc-<hash>. For instance:

Old format:

<c-foo c-foo_foo-host>
  <div c-foo_foo></div>
</c-foo>

New format:

<c-foo lwc-1hl7358i549-host>
  <div lwc-1hl7358i549></div>
</c-foo>

If you are relying on these attributes/classes in your tests, or for this.template.querySelector(), please avoid relying on them, as they could change at any time. Instead of this.template.querySelector(), you can also use lwc:ref.

This change was made as part of a performance improvement to optimize SVG rendering.

HTML template parsing is stricter

ℹ️ On the Salesforce Lightning platform, this change only applies to components with an API version of 59 or above.

Previously, certain HTML syntax errors were ignored by the LWC compiler but emitted a warning. Now, these syntax errors will result in a failed component compilation.

The most common syntax error is the following (in component HTML):

<template>
</template>
</template>

Note the double-ending </template> tag. Previously, this would emit a warning, but it now emits an error.

Other possible syntax errors include:

Unclosed elements:

<template>
  <div>
</template>

Invalid empty tags:

<template>
  <section/>
</template>

Stranded close tags:

</template>

Please fix any syntax warnings in LWC v2 before upgrading to LWC v3 to avoid this issue. We have a codemod that can automatically do this for you.

Implicit hydration is removed for CustomElementConstructor

ℹ️ This change only affects consumers of the CustomElementConstructor API.

The CustomElementConstructor API now creates custom elements that do not attempt to do implicit hydration (i.e. treating the component as if it were generated by Server-Side Rendering). This change should be a mostly positive one, as it will avoid a class of warnings that affected developers who were using standalone LWC components as custom elements.

Remove legacy package files and reorganize lwc package

ℹ️ This change only affects consumers of the lwc or @lwc/* open-source packages from npm.

Previously, the LWC packages published to npm used a bespoke format for each package. Some consumers may have taken a reliance on the quirks of these package structures, for instance:

import '@lwc/compiler/dist/commonjs/transformers/transformer.js'
import '@lwc/engine-dom/dist/engine-dom.js'
import '@lwc/synthetic-shadow/dist/synthetic-shadow.js'

Instead, consumers are encouraged to avoid deep-importing from these packages:

import '@lwc/compiler'
import '@lwc/engine-dom'
import '@lwc/synthetic-shadow'

Also, the lwc package used to contain transformed versions of various packages (e.g. IIFE format, UMD format, minified format, etc.).

Now, all packages export a single CommonJS and ES Module file, and the lwc package merely re-exports these other packages. If you need these packages in a special format (IIFE, UMD, minified, etc.), you are encouraged to run your own bundler/minifier to accomplish this, e.g. Rollup and Terser.

Changes

New Contributors

Full Changelog: v2.50.0...v3.0.0

v2.50.0

19 Jun 22:59
d25b3ed
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v2.49.1...v2.50.0

v2.49.1

13 Jun 23:39
3342835
Compare
Choose a tag to compare

What's Changed

Full Changelog: v2.49.0...v2.49.1

v2.49.0

13 Jun 23:15
9624f8b
Compare
Choose a tag to compare

What's Changed

  • fix(template-compiler): support custom renderer hooks for external components by @ekashida in #3559
  • perf: apply static optimization to lwc:ref by @nolanlawson in #3550
  • fix(hydration): log errors/warnings only in dev mode by @nolanlawson in #3534

Full Changelog: v2.48.0...v2.49.0

v2.48.0

06 Jun 23:23
3736e68
Compare
Choose a tag to compare

What's Changed

Full Changelog: v2.47.0...v2.48.0

v2.47.0

05 Jun 18:28
9a39a87
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v2.46.0...v2.47.0

v2.46.0

01 Jun 18:52
2a3aaa3
Compare
Choose a tag to compare

What's Changed

  • fix(engine-core): fix lwc:external attribute handling by @nolanlawson in #3508
  • feat(compiler): implement mechanism to gather internal metrics and logs by @jye-sf in #3536
  • perf(engine-core): optimize static elements with listeners by @nolanlawson in #3519
  • fix(rollup-plugin): ensure dependencies are declared by @nolanlawson in #3542

Full Changelog: v2.45.5...v2.46.0

v2.41.4

25 May 18:32
b42c5a9
Compare
Choose a tag to compare

What's Changed

  • fix(engine-core): execute scoped slot fragment in the slot owner's reactive observer by @ravijayaramappa in #3538

Full Changelog: v2.41.3...v2.41.4