Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal props should not participate in pre-upgrade element initialization. #129

Closed
theengineear opened this issue Mar 1, 2023 · 0 comments · Fixed by #130
Closed

Internal props should not participate in pre-upgrade element initialization. #129

theengineear opened this issue Mar 1, 2023 · 0 comments · Fixed by #130

Comments

@theengineear
Copy link
Collaborator

The point of the internal properties are to specifically not participate in the public element interface. I.e., element.title should have nothing to do with element.internal.title. This is usually benign, but can cause problems if the related public property has restrictions on how it’s meant to be used. For example, the following will fail if you register it and try to print it in the DOM:

class InternalExample extends XElement {
  static get properties() {
    return { children: { internal: true } }; // The "children" property is _read only_ on the public interface.
  }
}
// TypeError: Cannot set property children of #<Element> which has only a getter

Proposal

Simply don’t perform a lookup on the public interface for internal properties. This is the intended behavior, but there’s just no guard yet.

theengineear added a commit that referenced this issue Mar 1, 2023
Internal properties should be completely decoupled from the public
interface. This change set adds a guard to ensure that we don’t try to
lookup the property name on the public interface when upgrading the
element.

Closes #129.
theengineear added a commit that referenced this issue Mar 2, 2023
Internal properties should be completely decoupled from the public
interface. This change set adds a guard to ensure that we don’t try to
lookup the property name on the public interface when upgrading the
element.

Closes #129.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant