Skip to content

Releases: salesforce/lwc

v8.19.1

16 May 17:05
107a414
Compare
Choose a tag to compare

What's Changed

v8.19.0

09 May 19:11
7417320
Compare
Choose a tag to compare

Better types for template elements

TypeScript component authors can now specify a new property, __lwc_public_property_types__, to indicate to TypeScript which properties are available on the element created by a component. This prevents erroneous property definitions, which are otherwise unavoidable due to the way that TypeScript implements decorators.

Example

// <c-inferred-props>
class InferredProps extends LightningElement {
  @api exposed = 'hello'
  internal = 'secret'
}

// <c-explicit-props>
class ExplicitProps extends InferredProps {
  __lwc_public_property_types__?: {
    exposed: string
  }
}

class Container extends LightningElement {
  checkInferred() {
    const inferred = this.querySelector<LightningHTMLElement<InferredProps>>('c-inferred-props')!
    inferred.exposed // ✅ Valid, no type error
    inferred.internal // ❌ Invalid, but no type error!
  }

  checkExplicit() {
    const explicit = this.querySelector<LightningHTMLElement<ExplicitProps>>('c-explicit-props')!
    explicit.exposed // ✅ Valid, no type error
    explicit.internal // ✅ Invalid, and a type error occurs!
  }
}

In this example, the element interface for c-inferred-props is defined by LightningHTMLElement<InferredProps>. That interface has an erroneous property definition, internal. The internal property is part of the component interface, but is not decorated with @api, so it should not be part of the element interface.

The element interface for c-explicit-props is defined by LightningHTMLElement<ExplicitProps>. Because ExplicitProps defines __lwc_public_property_types__, the element interface does not include the internal property, which is the correct behavior.

What else changed?

Full Changelog: v8.18.2...v8.19.0

v8.16.5

05 May 20:31
826b829
Compare
Choose a tag to compare

What's Changed

v8.18.2

29 Apr 00:05
d2c5d22
Compare
Choose a tag to compare

What's Changed

v8.18.1

18 Apr 17:34
Compare
Choose a tag to compare

What's Changed

v8.18.0

14 Apr 19:59
529d080
Compare
Choose a tag to compare

What's Changed

  • chore: simplify style dedupe config by @wjhsf in #5271
  • feat(ssr-compiler): only mutate things if we're in a component @W-17748892 by @wjhsf in #5310
  • chore(ssr-compiler): remove fixed FIXMEs by @wjhsf in #5311
  • chore: bump version to 8.17.0 by @wjhsf in #5317
  • build(deps): bump vite from 6.2.3 to 6.2.4 by @dependabot in #5315
  • build(deps): bump the theoretically-non-breaking group with 15 updates by @dependabot in #5313
  • chore: re-introduce new constructor validation with gate by @jhefferman-sfdc in #5320
  • fix(ssr): don't break on unused default templates @W-18170898 by @wjhsf in #5319
  • test(decorators): add tests for decorated static props by @wjhsf in #5314
  • fix(wire): connect wire before calling connectedCallback @W-18205007 by @wjhsf in #5322
  • build(deps): bump vite from 6.2.4 to 6.2.5 by @dependabot in #5321
  • build(deps): bump the theoretically-non-breaking group with 9 updates by @dependabot in #5323
  • fix(ssr): address scope token test failures by @wjhsf in #5324
  • build(deps): bump koa from 2.15.4 to 2.16.1 by @dependabot in #5325
  • build(deps): bump vite from 6.2.5 to 6.2.6 by @dependabot in #5328
  • chore(fixtures): remove some empty files by @wjhsf in #5326
  • build(deps-dev): bump the theoretically-non-breaking group with 11 updates by @dependabot in #5332
  • feat(release): add shell scripts to automate PR creation by @wjhsf in #5330
  • chore: enable engine-server fixture tests in production mode @W-17972327 by @wjhsf in #5327
  • chore: bump version to v8.18.0 by @wjhsf in #5333
  • @W-18268582 chore: release 8.18.0 by @wjhsf in #5334

Full Changelog: v8.16.4...v8.18.0

v8.17.0

11 Apr 16:41
v8.17.0
c40065c
Compare
Choose a tag to compare

What's Changed

  • chore: simplify style dedupe config by @wjhsf in #5271
    • WARNING: This is a breaking change for users of the experimental new SSR packages
  • feat(ssr-compiler): only mutate things if we're in a component @W-17748892 by @wjhsf in #5310
  • chore(ssr-compiler): remove fixed FIXMEs by @wjhsf in #5311
  • chore: bump version to 8.17.0 by @wjhsf in #5317
  • chore: release 8.17.0 @W-18174087 by @wjhsf in #5318

Full Changelog: v8.16.4...v8.17.0

v8.16.4

25 Mar 20:50
672be9a
Compare
Choose a tag to compare

What's Changed

  • chore(integration-karma): remove programmatic DSD check by @wjhsf in #5299
  • chore(dependabot): separate out all @wdio packages by @wjhsf in #5300
  • build(deps): bump vite from 6.0.11 to 6.2.3 by @dependabot in #5305
  • chore(eslint): update config to catch .only and .skip files by @wjhsf in #5303
  • fix(ssr): callable wire adapter behavior by @divmain in #5304

v8.16.3

19 Mar 17:57
ba8ff37
Compare
Choose a tag to compare

What's Changed

v8.16.2

17 Mar 18:39
beecebe
Compare
Choose a tag to compare

What's Changed