[enhancement] Automate cleanup and resume and deprecate discard-on-disconnect
Features
Suspend I18N features on disconnect and make the element discardable
Resume I18N features on reconnect
Deprecate discard-on-disconnect boolean attribute
discard-on-disconnect attributes have no effects any longer
Notes
Each element instance must perform its own cleanup on disconnectedCallback() as well as calling super.disconnectedCallback() so that the instance can be garbage-collected if no references to it exists
I18N features are enabled for created but not-yet-connected elements
connectedCallback() must handle reconnection properly if it is required
Notes on Debugging
If an element object is shown on devtools console with console.log(element), the element object is not garbage-collected even if it has no references in the page
[enhancement] Automate cleanup and resume and deprecate
discard-on-disconnect
Features
discard-on-disconnect
boolean attributediscard-on-disconnect
attributes have no effects any longerNotes
disconnectedCallback()
as well as callingsuper.disconnectedCallback()
so that the instance can be garbage-collected if no references to it existsconnectedCallback()
must handle reconnection properly if it is requiredNotes on Debugging
console.log(element)
, theelement
object is not garbage-collected even if it has no references in the page