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

Introduce turbo:frame-missing event #445

Merged
merged 5 commits into from
Aug 3, 2022

Commits on Aug 1, 2022

  1. Introduce turbo:frame-missing event

    Closes [hotwired#432][]
    Follow-up to [hotwired#94][]
    Follow-up to [hotwired#31][]
    
    When a response from _within_ a frame is missing a matching frame, fire
    the `turbo:frame-missing` event.
    
    There is an existing [contract][] that dictates a request from within a
    frame stays within a frame.
    
    However, if an application is interested in reacting to a response
    without a frame, dispatch a `turbo:frame-missing` event. The event's
    `target` is the `FrameElement`, and the `detail` contains the
    `fetchResponse:` key. Unless it's canceled (by calling
    `event.preventDefault()`), Turbo Drive will visit the frame's URL as a
    full-page navigation.
    
    The event listener is also a good opportunity to change the
    `<turbo-frame>` element itself to prevent future missing responses.
    
    For example, if the reason the frame is missing is access (an expired
    session, for example), the call to `visit()` can be made with `{ action:
    "replace" }` to remove the current page from Turbo's page history.
    
    [contract]: hotwired#94 (comment)
    [hotwired#432]: hotwired#432
    [hotwired#94]: hotwired#94
    [hotwired#31]: hotwired#31
    seanpdoyle committed Aug 1, 2022
    Configuration menu
    Copy the full SHA
    3a20497 View commit details
    Browse the repository at this point in the history
  2. re-run CI

    seanpdoyle committed Aug 1, 2022
    Configuration menu
    Copy the full SHA
    22c3ff3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1043f0d View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2022

  1. Add console warning if a full-page visit is triggered as a result of …

    …missing matching frame
    dhh committed Aug 3, 2022
    Configuration menu
    Copy the full SHA
    8c24548 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'main' into pr/445

    * main:
      Add turbo:fetch-request-error event on frame and form network errors (hotwired#640)
      Return `Promise<void>` from `FrameElement.reload` (hotwired#661)
      Replace LinkInterceptor with LinkClickObserver (hotwired#412)
      Don't convert `data-turbo-stream` links to forms (hotwired#647)
    dhh committed Aug 3, 2022
    Configuration menu
    Copy the full SHA
    52c9ced View commit details
    Browse the repository at this point in the history