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

Port eager components off of XSLT #1856

Open
wants to merge 11 commits into
base: hermione
Choose a base branch
from
Open

Conversation

philipcaisip
Copy link
Contributor

Registration for any component that can be eager (i.e. submenu, tab, collapsible, figure, panel, section) now done with a HTML custom element called wc-ajax-eager instead of XSLT.

Phil Caisip added 11 commits May 7, 2024 16:13
Not fully ready at this stage. Still need to ensure ids in tests are
well-formed and exists, otherwise it will not reach the ajax trigger
fire and the test will timeout and fail. Really just a checkpoint
commit.
Previously thought that the container element should be the one being
passed to containerload register, but that is wrong. Its the content
(another element in the container) that is getting eager loaded/
registered.
Previously getting rendered inside the attributes of the parent
component, which is invalid.
"wc-ajax-eager" elements are now used to mark eager containers.
Currently they are simple divs that sit as a child of the eager
containers, with that container's id as its inner html. This is how ids
are fed into the ajax register.

Currently, since the ids are given as text inside the div, users can
actually see that container id for the few seconds that the ajax load
is happening. This should be fixed in a future commit.
Gets rid of problem with storing id in the inner html where users can
briefly see the id of the container before the ajax load happens.

Tests (both js and java) need to be changed still to reflect all
changes so far.
Previous xslt did not render the contents of eager panels. This is a
problem for the current implementation since the html custom element
that acts as a marker for eager panels is a child element of that panel.
That code is commented out for now; will have to ask best way to deal
with that/whether that check is necessary.

Other eager containers seem to be working fine with new implementation
EXCEPT for figures and sections. Will have to investigate.
Eager panels, figures, and sections all had a problem where the xslt
would not copy their child wc-ajax-eager element. This led to them not
getting loaded properly since that custom html component can't run its
registration scripts on page load. That's fixed now through some xslt
changes.

Java and js unit tests still need to be redone to properly test the new
implementations.
Some unit tests fail with the new html custom element code. In
particular, anything that does an XSD schema check in the unit test
fails when it sees the new html element that it doesn't expect.

Those schema checks are commented out since we wanna move away from all
that eventually anyways.
Things like changing * imports to individual modules and removing unused
imports. Probably got introduced in the background by IDE.
Copy link

sonarqubecloud bot commented Jun 4, 2024

@philipcaisip philipcaisip marked this pull request as ready for review June 4, 2024 03:15
@philipcaisip philipcaisip requested a review from ricksbrown June 4, 2024 03:15
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.

1 participant