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

Injection Fixes #238

Merged
merged 4 commits into from
Mar 23, 2024
Merged

Injection Fixes #238

merged 4 commits into from
Mar 23, 2024

Conversation

adsuth
Copy link
Collaborator

@adsuth adsuth commented Mar 13, 2024

These changes aim to resolve issues with the new injection system.

Injections are now dynamically checked as part of the main interval.
We check for injections by query selecting the injected elements and checking if they are marked as being injected (via an attribute).
This way, if old shorts are loaded and the injected elements are removed, we can react to that and inject them again.

This unfortunately removes the error messaging, but Im not sure if that was particularly useful anyway

When adding new injected elements, you now should:

  • Add a new enum for the element to InjectionItemsEnum (unless its a child of one thats already there)
  • Add <your element>.setAttribute(INJECTION_MARKER, ""); to your method that inserts the new element
  • Add a new case for your element in injectIfNotPresent() - you can just copypaste one thats there (note the getter should be for the element that has the marker)

@adsuth
Copy link
Collaborator Author

adsuth commented Mar 13, 2024

List of issues this may resolve:

(there may be more)

@ynshung
Copy link
Owner

ynshung commented Mar 23, 2024

Thanks for the fix!

@ynshung ynshung merged commit aac508a into ynshung:master Mar 23, 2024
2 checks passed
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 this pull request may close these issues.

2 participants