Skip to content

Releases: salesforce/lwc

v7.1.5

10 Oct 02:40
86682ec
Compare
Choose a tag to compare

What's Changed

Full Changelog: v7.1.4...v7.1.5

v8.1.3

04 Oct 21:16
2868e53
Compare
Choose a tag to compare

What's Changed

  • fix(ssr): avoid undefined appended to tag name by @nolanlawson in #4583
  • fix(ssr): add missing methods from LightningElement @W-16614337 by @wjhsf in #4585
  • build(deps): bump the theoretically-non-breaking group with 14 updates by @dependabot in #4588
  • fix(ssr): use style normalizer from template compiler by @nolanlawson in #4584
  • fix(ssr): normalize class names @W-16869035 by @wjhsf in #4590
  • fix(ssr): add more LightningElement methods @W-16867451 by @wjhsf in #4589
  • fix(ssr): improve error message when test succeeds but formatting fails by @wjhsf in #4591
  • fix(engine-server): setAttribute should gracefully handle non-string values by @ekashida in #4593
  • fix(hydration): fix validationOptOut with auto-detection by @nolanlawson in #4592
  • test(fixtures): add option to have human-friendly description by @wjhsf in #4595
  • feat(lwc): re-export @lwc/ssr-compiler and @lwc/ssr-runtime @W-16856898 by @wjhsf in #4596
  • fix(ssr): disallow </style> in CSS files @W-16882876 by @wjhsf in #4598
  • fix(ssr-compiler): define IR to ES map for lwc:external nodes by @ekashida in #4599
  • fix(ssr-compiler): generate scope tokens using component name and namespace by @ekashida in #4597
  • test(imports): add fixture for LWC imports from helper file @W-16872166 by @wjhsf in #4601
  • chore: remove quotes from error message by @wjhsf in #4602
  • fix(ssr-compiler): setAttribute and getAttribute by @ekashida in #4603
  • chore: update dependencies by @jye-sf in #4604
  • chore: add DataCallback as type export in lwc by @jmsjtu in #4607
  • fix(ssr-compiler): boolean attribute value as empty string by @ekashida in #4606

Full Changelog: v8.1.2...v8.1.3

v8.1.2

27 Sep 18:47
e97cb39
Compare
Choose a tag to compare

What's Changed

Full Changelog: v8.1.1...v8.1.2

v8.1.1

26 Sep 17:01
bdde92f
Compare
Choose a tag to compare

What's Changed

Full Changelog: v8.1.0...v8.1.1

v8.1.0

18 Sep 16:57
5889f3a
Compare
Choose a tag to compare

What's Changed

Full Changelog: v8.0.0...v8.1.0

v8.0.0

06 Sep 19:53
1f9e31f
Compare
Choose a tag to compare

What's Changed

The breaking changes in this release only impact TypeScript users; there is no change in runtime behavior, as compared to v7.2.6.

Important

TypeScript's experimentalDecorators is no longer supported; you must either specify "experimentalDecorators": false or remove the option from your TSConfig.

This release contains changes to the type signature of the @wire decorator, to enable better type checking of the provided values. Given @wire(adapter, config) prop, the types of config and prop now must match the types used by adapter. The type checking also successfully resolves reactive props (string starting with $) to the type used by the component.

In the example below, the component passes type checking with LWC v7, but has three new type errors in LWC v8.

type Config = { id: number }
type Book = { title: string, author: string }
declare const getBook: WireAdapterConstructor<Config, Book>

class Component extends LightningElement {
  bookId = 123
  authorName = 'Codey the Bear'

  // Valid: simple case
  @wire(getBook, { id: 123 }) valid?: Book
  // Valid: `bookId` on the component is a number
  @wire(getBook, {id: '$bookId'} as const) validReactiveProp?: Book
  // Invalid: `Author` is not `Book`
  @wire(getBook, { id: 123 }) invalidPropType?: Author
  // Invalid: `true` is not a number
  @wire(getBook, { id: true }) invalidConfigType: Book
  // Invalid: `authorName` prop on the component is not a number
  @wire(getBook, {id: '$authorName'} as const) invalidReactiveProp?: Book

Limitations

  • Due to the way decorators are implemented in TypeScript, the type of the prop cannot be inferred from the wire adapter; you must provide an explicit type.
  • To get the most accurate validation of your types, use const assertions on your config object. Without a const assertion, the type system cannot distinguish between a reactive prop (e.g. "$authorName") and a regular string (e.g. "Codey the Bear"). As a consequence, all values of type string are not type checked.
    • For example, for a config of type {id: number}, providing the object {id: "123"} will pass validation, but {id: "123"} as const will not.
  • Due to the above constraints, the reported type errors can appear complex and hard to understand. They typically boil down to validating that your config object and prop type both match the type expected by the wire adapter.

Full Changelog: v7.2.6...v8.0.0

v7.2.6

05 Sep 17:56
1a775cc
Compare
Choose a tag to compare

What's Changed

Full Changelog: v7.2.5...v7.2.6

v7.1.4

05 Sep 18:55
43bf9cd
Compare
Choose a tag to compare

What's Changed

Full Changelog: v7.1.3...v7.1.4

v7.2.5

04 Sep 20:22
934e666
Compare
Choose a tag to compare

What's Changed

Full Changelog: v7.2.4...v7.2.5

v7.2.4

04 Sep 00:24
8d07db9
Compare
Choose a tag to compare

What's Changed

Full Changelog: v7.2.3...v7.2.4