Skip to content

Allow components to opt in to native custom element lifecycle #4252

@nolanlawson

Description

@nolanlawson

Edit: there is now an RFC.

#4249 indicates that it may not be safe to compose native and synthetic lifecycle components together. For that reason, we should perhaps treat it similarly to native vs synthetic shadow DOM, and allow components to opt-in instead. E.g.:

export default class extends LightningElement {
  static lifecycleSupportMode = 'native' // native
  static lifecycleSupportMode = 'reset' // synthetic
}

There is an open question about whether this should affect child trees, similar to native shadow DOM when using shadowSupportMode. It's not clear that this would help much, since #4249 is more around slotting rather than parent-child relationships (although the same issues would also apply to parent-child relationships).

Related: #3198

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions