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

Query all eager loading turbo frames and patch their innerHTML #164

Merged
merged 4 commits into from
Nov 22, 2021

Conversation

julianrubisch
Copy link
Contributor

Allows to fetch and patch lazy loaded turbo frames present in the response eagerly.

Copy link
Contributor

@leastbad leastbad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far as I understand the functionality of lazy-loaded Turbo Frames, this looks sound to me. I guess they use DOM ids to identify frames? For some reason, I thought they gave them arbitrary identifiers.

Depending on your reaction to one of my questions, you might need to make the lazy fetch into a recursive function.

javascript/elements/updates_for_element.js Outdated Show resolved Hide resolved
javascript/elements/updates_for_element.js Outdated Show resolved Hide resolved
javascript/elements/updates_for_element.js Outdated Show resolved Hide resolved
javascript/elements/updates_for_element.js Outdated Show resolved Hide resolved
javascript/elements/updates_for_element.js Outdated Show resolved Hide resolved
@julianrubisch julianrubisch changed the title Query all lazy loading turbo frames and patch their innerHTML Query all eager loading turbo frames and patch their innerHTML Nov 20, 2021
@julianrubisch
Copy link
Contributor Author

Yep, frames all use IDs right now.

@julianrubisch julianrubisch force-pushed the ssr-turbo-frames branch 2 times, most recently from 8685c71 to 6ffc111 Compare November 21, 2021 18:35
@leastbad
Copy link
Contributor

Excited to see this coming together.

@julianrubisch julianrubisch marked this pull request as ready for review November 22, 2021 07:50
@julianrubisch
Copy link
Contributor Author

So I can declare success! I threw together a couple of test cases including nested eager loaded frames, and it worked.

Thanks to @ParamagicDev for your support and reviewing it en passent 🙌

Copy link
Contributor

@leastbad leastbad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with comments re: naming and a request for clarification.

javascript/utils.js Show resolved Hide resolved
javascript/utils.js Show resolved Hide resolved
javascript/elements/updates_for_element.js Show resolved Hide resolved
@leastbad leastbad merged commit 2a77704 into stimulusreflex:master Nov 22, 2021
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.

None yet

3 participants