-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve Frame-to-Page Visit event ordering
The problem --- By attempting to avoid unnecessary renders and events by introducing the `willRender:` Visit option, the initial `<turbo-frame data-turbo-action="...">` implementation was skipping several crucial lifecycle hooks. For example, the resulting Visit would fire a `turbo:render`, but would not fire a `turbo:load`. This left the `<html>` element in an inconsistent state without cleaning up any `[data-turbo-preview]` or `[aria-busy]` attribute modifications. The solution --- Forego the `willRender:` option, and instead propose a visit with a pre-populated `statusCode`, `redirected`, and `responseHTML` value so that the `Session` (including all of its hooks) can handle transparently the same as other `Visit` instances. The result is much simpler than the original implementation: a promoted Visit doesn't receive any specialized treatment, so it stands to benefits from all the existing plumbing.
- Loading branch information
1 parent
33507e5
commit c5479d4
Showing
3 changed files
with
32 additions
and
13 deletions.
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
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
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