Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hotwired/turbo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.2.5
Choose a base ref
...
head repository: hotwired/turbo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.3.0
Choose a head ref
  • 15 commits
  • 37 files changed
  • 7 contributors

Commits on Jan 31, 2023

  1. Fix test failure on Firefox for Mac

    This test was consistently failing on my Mac machine.
    
    It was because Firefox for Mac doesn't focus on links on TAB presses.
    
    Ref. https://stackoverflow.com/a/11713537
    afcapel committed Jan 31, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0571735 View commit details

Commits on Feb 1, 2023

  1. Copy the full SHA
    e108616 View commit details

Commits on Feb 2, 2023

  1. Merge pull request #862 from hotwired/fix-firefox-mac-test-failure

    Fix test failure on Firefox for Mac
    afcapel authored Feb 2, 2023
    Copy the full SHA
    ac2f78a View commit details

Commits on Feb 4, 2023

  1. Migrate from intern to web-test-runner (#866)

    * migrate to WTR
    
    * migrate to web-test-runner
    
    * remove intern dependency
    
    * remove intern_test_case
    
    * chore: prettier
    
    * update to tdd
    KonnorRogers authored Feb 4, 2023
    Copy the full SHA
    a7d6566 View commit details

Commits on Feb 7, 2023

  1. Don't break out of frames when frame missing (#863)

    Don't break out of frames when frame missing
    
    This changes the default behaviour when a frame response is missing its
    expected `<turbo-frame>` element.
    
    Previously, when the response was missing its frame, we would trigger a
    `turbo:frame-missing` event, and then (provided that event wasn't
    cancelled) perform a full page visit to the requested URL.
    
    However there are cases where the full reload makes things worse:
    
    - If the frame contents were non-critical, reloading the page can turn a
      minor bug into a major one.
    - It can mask some bugs where frames were intend to explicitly navigate
      out of the frame (`target="_top"`), by incurring a second request that
      loads the page that makes it seem as if it's working corrects.
    - It leaves the user at a URL that may never be capable of rendering a
      valid response (since that URL was only intended to serve a particular
      frame). That means refreshing the page is no help in getting back to a
      working state.
    - It can lose other temporary state on a page, like form values.
    
    With this change, we no longer perform the full page visit. Instead, we
    handle a missing frame by doing two things:
    
    - Write a short error message into the frame, so that the problem is
      visible on the page.
    - Throw an exception, which should make the problem quite obvious in
      development, and which allows it to be easily gathered by exception
      monitoring tools in production.
    
    We keep the `turbo:frame-missing` event exactly as before, so
    applications can still hook in to perform alternative behaviour if they
    want.
    kevinmcconnell authored Feb 7, 2023
    Copy the full SHA
    91ee8f6 View commit details
  2. Respect turbo-visit-control for frame requests (#867)

    Turbo normally performs a fill page reload whenever a response contains
    the appropriate `turbo-visit-control` meta tag:
    
        <meta name="turbo-visit-control" content="reload">
    
    Such responses are considered "not visitable".
    
    For frame requests, we have previously been ignoring any
    `turbo-visit-control` set in the response, and instead treating all
    valid frame responses as "visitable".
    
    This commit changes this behaviour so that `turbo-visit-control` will be
    treated consistently for both frame and non-frame requests.
    
    As well as being more consistent, this provides a useful escape hatch
    for situations where a frame request redirects to something that should
    be a full page reload, but which would be prevented due to that content
    missing the expected frame. The class example of this is when an expired
    session causes a frame request to be redirected to a login page. By
    including `turbo-visit-control` on that login page, we can ensure that
    it is always rendered as a full page, and never hidden by a failed frame
    request.
    kevinmcconnell authored Feb 7, 2023
    1
    Copy the full SHA
    1e78f3b View commit details

Commits on Feb 14, 2023

  1. Copy the full SHA
    61201b9 View commit details
  2. Merge pull request #870 from hotwired/jh/contributing

    Freshen and copy-edit the contributing documentation
    packagethief authored Feb 14, 2023
    1
    Copy the full SHA
    3351d38 View commit details

Commits on Feb 15, 2023

  1. Deprecate [data-turbo-cache=false] in favor of [data-turbo-temporary] (

    …#871)
    
    Renames the `[data-turbo-cache=false]` attribute (used to denote temporary
    elements that should be removed before caching) to `[data-turbo-temporary]` for
    better similarity with `[data-turbo-permanent]`, its conceptual opposite.
    
    This is a superficial change, but worth it in terms of cohesion, I think. The
    pairing of "temporary" with "permanent" is just too good to ignore. Also, given
    the existence of `turbo-cache-*` as the namespace for page-level cache control,
    a unique name is less likely to confuse.
    
    References:
    - #238
    packagethief authored Feb 15, 2023
    1
    Copy the full SHA
    e013072 View commit details

Commits on Feb 23, 2023

  1. Allow changing the submitter text during form submission (#869)

    This change introduces a new optional data-turbo-submits-with text
    attribute that can be set on submit elements (inputs or buttons) in
    Turbo forms.
    
          <form action="/" method="post">
            <input type="submit" value="Save" data-turbo-submits-with="Saving...">
          </form>
    
    When the form is in a submitting state Turbo will change the submitter
    content -the input value for inputs, and the innerHTML for buttons- with
    the data-turbo-submits-with value, and restore the original value when the
    submission ends.
    
    This is a common requirement in many apps, to style the form submitting
    state and give feedback to the user that a click is already being
    processed.
    afcapel authored Feb 23, 2023
    1
    Copy the full SHA
    455ffe0 View commit details

Commits on Feb 24, 2023

  1. 1
    Copy the full SHA
    133271f View commit details
  2. 1
    Copy the full SHA
    483ef32 View commit details

Commits on Feb 27, 2023

  1. Form submissions from frames should clear cache (#882)

    Usually when submitting a form with a method other than `GET`, we clear
    the snapshot cache. This helps to avoid cases where we might show a
    stale view of some data that we just mutated.
    
    Form submissions from inside frames were not doing this. But they ought
    to, for the same reason: that form submission may have mutated some data
    that causes other recent pages to become stale.
    
    To avoid this, we can clear the cache after processing a non-`GET` form,
    or after any failed form submission, to mirror what we do when the form
    is outside of any frames.
    kevinmcconnell authored Feb 27, 2023
    1
    Copy the full SHA
    39affe5 View commit details

Commits on Feb 28, 2023

  1. Rename isIdempotent to isSafe (#883)

    The method name was a bit misleading, as what we're actually checking
    for here is whether the method is [safe][0].
    
    We can also now make use of this method in a couple of places where we
    clear the snapshot cache after form submissions. The logic there is to
    clear the cache when performing an operation that is unsafe.
    
    [0]: https://developer.mozilla.org/en-US/docs/Glossary/Safe/HTTP
    kevinmcconnell authored Feb 28, 2023
    1
    Copy the full SHA
    7bd2ce8 View commit details

Commits on Mar 1, 2023

  1. Turbo v7.3.0

    dhh committed Mar 1, 2023
    1
    Copy the full SHA
    4593d06 View commit details
Loading