-
Notifications
You must be signed in to change notification settings - Fork 435
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
Lift the frame morphing logic up to FrameController.reload #1192
Merged
jorgemanrubia
merged 25 commits into
hotwired:main
from
krschacht:frame-reload-uses-morphing
Sep 11, 2024
+65
−18
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
c03c893
Add new frame morphing refresh tests which fail
krschacht 047a479
Get tests passing
krschacht e1fde68
Refactor code to remove duplication
krschacht 5427b77
Remove comment
krschacht 9fd1e9d
remove logging
krschacht a5a87e4
Remove testing server randNum hack
krschacht 87c9553
Refactor to extract method & revert to class
krschacht 07c3577
Refactor morphElements class
krschacht 699f66f
Merge branch 'main' into frame-reload-uses-morphing
krschacht 6abb120
wip
krschacht 38e4d2c
Remove extraction added in another PR
krschacht 8344e4d
Update reference to use new MorphingFrameRenderer
krschacht a342115
Reword test names
krschacht 1ed1dc1
fixed typo
krschacht f738bdb
Only morph frame when using reload()
krschacht e956dd4
wip
krschacht fceb2cb
Fix a broken test
krschacht 3af219d
Rewrite test fix to use playwright API
krschacht a0bf9a3
Fix unused reference
krschacht f45697c
Flip failing test to reflect product decision
krschacht 55266c7
Merge branch 'main' into frame-reload-uses-morphing
krschacht 8f0a949
Merge branch 'main' into frame-reload-uses-morphing
krschacht 6801493
Revert "Flip failing test to reflect product decision"
krschacht 795ab37
Correct logic for frame reloading
krschacht 61bd384
revert unintended files
krschacht File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry if I explained wrong. Turbo frames that aren't reloaded by morphing have to be reset correctly. This test should be fine.
Turbo frames that don't have the conditions to be reloaded with morphing are affected in the first round of morphing, therefore, they are morphed according to the changes coming from the server. Turbo frames that can be reloaded with morphing due to the presence of the
src
attribute andrefresh="morph"
are ignored in the first round, and then refreshed using morphing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just about to send a long final comment saying I finished. :) Happy to do this either way. This test is a bit confusing so it took me a bit to fully make sense of. In your longer explanation, you said what my expectation would be. Specifically:
This test was enforcing the opposite, so I flipped it to reflect what you said here. ^ And it fits my intuition that if a user navigations a turbo frame, and it's implicitly reload="refresh" (not morph) then I would expect that navigation to stay. But you think we should revert it back since it started with no src when the page loaded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's correct, but only for Turbo frames marked with
refresh="morph"
attribute. Sorry if I wasn't clear enough.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I mean is that the goal of the test as it was before was correct. Turbo frames that don't contain the
refresh="morph"
attribute are reset. We only retain the state of Turbo frames that are reloaded with morphing. The rest are morphed in the first round according to what the server returns in the request made at the time of the page refresh.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test has been reverted (so that it fails again) and the logic has been corrected (so now the test passes).
I think that's it and things are now ready. 🤞