Releases: salesforce/lwc
v1.5.1
v1.5.0
Improvements
- #1395 - engine: A Lightning web component class can be used to register a custom element in the registry. This change introduces a new way to access the class constructor. This change also soft deprecates the previous method of creating the constructor.
class MyComponent extends LightningElement {
}
customElements.define('my-component', MyComponent.CustomElementConstructor);
- #1459, #1823 - wire-service: Decouples the wire service from the LWC engine and implements the underlying reactive tracking for wired configuration and wired methods using the same reactivity system as LWC. See all the details in the wire reform decorator RFC.
Breaking changes
- Current wire
adapterId
s defined asSymbol
will be broken with this update.
Upgrade path to LWC v1.5.0:
export const adapterId = Symbol('AdapterId');
// should change to:
export const adapterId = () => {
throw new Error("Imperative use is not supported. Use @wire(adapterId)");
};
Bug Fixes
- #1793 - synthetic-shadow: Fixed an issue where invoking
Node.prototype.contains()
on the same node was returningfalse
. - #1794 - engine: Fixed an issue where slotted content became invisible during a subsequent re-rendering of the slot receiver.
- #1819 - integration-karma: Disabled two test cases related to AOM property reflection due to browser bugs.
Internal
- #1785: Various documentation typo fixes.
- #1786 - (synthetic-shadow): Reverts #1754
- #1796, #1825 : Routine dependency updates.
- #1828 - engine: When a component class has been marked to have a circular reference, use the constructor after resolving the circular reference.
Security
- #1804: Fixed security advisory CVE-2020-7598.
v1.4.0
New Feature
- #1602 - module-resolver: Synchronously resolve an LWC module from its specifier. The API is available via the
@lwc/module-resolver
package. The resolver algorithm and design can be found in this RFC.
API
resolveModule(specifier, importer, options)
Example
import { resolveModule } from '@lwc/module-resolver';
const result = resolveModule('x-foo', './index.js');
console.log(result);
Improvements
- #1752 - compiler: With this change, bundled output of the
@lwc/compiler
uses named exports. (This change was reverted in v1.5.1.)
Internal
v1.3.12
v1.3.11
v1.3.10
Improvements
- #1754 - synthetic-shadow: Remove polyfill that ensures the
focusin
andfocusout
events are composed, now that all supported browsers implement the correct behavior. - #1755 - synthetic-shadow: Remove polyfill that ensures the
click
event is composed, now that all supported browsers implement the correct behavior. Note that this change was reverted in v1.5.0 (#1786) since it was discovered that the issue still exists in an early version of Safari 12.
Internal
- #1770: Enable lint rules for Jest and Jasmine tests.
v1.3.9
v1.3.8
Improvements
- #1764 - style-compiler: This change modifies the way the compiler concatenates strings when producing the stylesheet by using
Array.prototype.join('')
instead of the+
operator to avoid aRangeError: Maximum call stack size exceeded
error thrown by Rollup. This processing is done to inject the tokens used for the shadow DOM emulation at runtime.
Internal
v1.3.7
v1.3.6
Bug Fixes
-
#1750 - compiler: This change disables the
wrap_func_args
terser output. This option breaks the regular expression used for module namespace mapping. On top of this, the latest JavaScript VMs already optimize for such a pattern and the function expression wrapping might actually hurt performance. -
#1728 - wire-service: This change fixes an issue in which a wire adapter receives an incomplete config when the wire instance has 2 or more reactive parameters with the same head:
{ p1: '${head}.foo', p2: ${head}.bar }
.
Internal
-
#1746 - engine: This change removes the p render API and related code since the compiler doesn't produce VNodes for comment.
-
#1745 - engine: This change removes the
$fromTemplate$
marker which is an old artifact that wasn't removed with #1362 (engine: Remove attribute mutation restrictions). -
#1749 - chore: Weekly dependencies update. Updated packages:
@babel/[email protected]
,@babel/[email protected]
,@types/[email protected]
,@typescript-eslint/[email protected]
,@typescript-eslint/[email protected]
,[email protected]
,[email protected]
,[email protected]
,[email protected]
,[email protected], [email protected]
,[email protected]