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

Test and document the standard component lifecycle events #127

Closed
bob2517 opened this issue Mar 17, 2021 · 3 comments
Closed

Test and document the standard component lifecycle events #127

bob2517 opened this issue Mar 17, 2021 · 3 comments
Assignees
Labels
docs to do Documentation still needs doing before this can get released done on branch This issue has been committed to the latest branch, and will get merged with the next release
Milestone

Comments

@bob2517
Copy link
Member

bob2517 commented Mar 17, 2021

It's a easy forgotten fact, by me mainly, that Active CSS shadow DOM components do actually support the standard shadow DOM component lifecycle events, as well as beforeComponentOpen and componentOpen.

I just don't use them. I don't need to clean-up anything with disconnectedCallback as everything related to a component is removed when a component is removed. But it's probably just a matter of time and use cases, as everything usually is.

So test these and specify how to use them in the documentation...

@bob2517 bob2517 self-assigned this Mar 17, 2021
@bob2517 bob2517 added this to the 2.6.0 release milestone Mar 17, 2021
@bob2517 bob2517 added the docs to do Documentation still needs doing before this can get released label Mar 17, 2021
@bob2517 bob2517 removed this from the 2.6.0 release - await/pause milestone Jun 2, 2021
@bob2517 bob2517 added the testing needed More testing is needed before release label Nov 28, 2021
@bob2517
Copy link
Member Author

bob2517 commented Sep 30, 2023

This does need doing - tagging for 2.15.0 milestone.

@bob2517 bob2517 added this to the 2.15.0 milestone Sep 30, 2023
@bob2517 bob2517 removed this from the 2.15.0 milestone Nov 12, 2023
@bob2517 bob2517 added the in progress This issue is currently being worked on label Nov 19, 2023
@bob2517
Copy link
Member Author

bob2517 commented Nov 26, 2023

The following events are now supported on the branch:

&:connectedCallback (pseudonym for &:beforeComponentOpen)
&:disconnectedCallback (when detecting the removal of an element)
&:attrChange[Name of attribute] (to detect changes to attribute via an event)

To get the attribute value inside the change event, if not using them reactively with the double-curly syntax, you use the {@host:attr} syntax. For example if monitoring the attribute "cheese" in a custom element component:

&:attrChangeCheese {
    console-log: "attribute changed from {@host:cheese-old}" to {@host:cheese}.";
}

The value of the attribute prior to the change is available by adding a "-old" to the name of the attribute.

@bob2517 bob2517 added done on branch This issue has been committed to the latest branch, and will get merged with the next release and removed in progress This issue is currently being worked on testing needed More testing is needed before release labels Nov 26, 2023
@bob2517
Copy link
Member Author

bob2517 commented Nov 26, 2023

Closing pending release

@bob2517 bob2517 closed this as completed Nov 26, 2023
@bob2517 bob2517 added this to the 2.16.0 milestone Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs to do Documentation still needs doing before this can get released done on branch This issue has been committed to the latest branch, and will get merged with the next release
Projects
None yet
Development

No branches or pull requests

1 participant