8000 Comparing v8.0.0-beta1...v8.0.0-beta.2 · hotwired/turbo · GitHub
[go: up one dir, main page]

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: v8.0.0-beta1
Choose a base ref
...
head repository: hotwired/turbo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v8.0.0-beta.2
Choose a head ref
  • 18 commits
  • 31 files changed
  • 9 contributors

Commits on Nov 27, 2023

  1. Avoid infinite recursion from window.fetch name collision

    Closes [#526][]
    
    Prevent naming collisions between the new `Turbo.fetch` function and the
    built-in `window.fetch` function.
    
    To do so, create a module-local reference to `window.fetch`, and define
    the exported function as `fetchWithTurboHeaders`. At export-time, rename
    to `fetch` so that consumers can continue to import it as `Turbo.fetch`.
    
    [#526]: hotwired/turbo-rails#526
    seanpdoyle committed Nov 27, 2023
    Configuration menu
    Copy the full SHA
    9a4c994 View commit details
    Browse the repository at this point in the history
  2. Page refreshes: Use pathname instead of href to detect if locations a…

    …re equal
    
    Before this commit, URLs had to be exactly the same for the possibility of a refresh with morphing.
    Now, it only checks that the paths are equal, regardless of whether they have different search params.
    brunoprietog committed Nov 27, 2023
    Configuration menu
    Copy the full SHA
    e7a2c7a View commit details
    Browse the repository at this point in the history
  3. Merge pull request #1077 from seanpdoyle/avoid-fetch-name-collisions

    Avoid infinite recursion from `window.fetch` name collision
    jorgemanrubia authored Nov 27, 2023
    Configuration menu
    Copy the full SHA
    325216e View commit details
    Browse the repository at this point in the history
  4. Export StreamActions as property of window.Turbo (#1073)

    * Export StreamActions as property of window.Turbo
    
    This was removed in #1049
    but it's still used in the turbo-rails test suite.
    
    https://github.com/hotwired/turbo-rails/blob/c3ca7009c0759563ec65ecf1bc60a9af1ff33728/test/system/broadcasts_test.rb#L137
    
    * Remove circular dependency
    
    * Assert that Turbo interface is exposed via window global
    Alberto Fernández-Capel authored Nov 27, 2023
    Configuration menu
    Copy the full SHA
    4f334da View commit details
    Browse the repository at this point in the history
  5. Restructure to avoid internal window.Turbo access

    Replace accessing the `recentRequests` property through the
    `window.Turbo.session` object.
    
    In its place, restructure the object's dependency graph so that the
    `http/fetch` module constructs the `LimitedSet` instance, and the
    `Session` accepts that instance as a property.
    seanpdoyle committed Nov 27, 2023
    Configuration menu
    Copy the full SHA
    23d0cb4 View commit details
    Browse the repository at this point in the history
  6. Merge pull request #1078 from seanpdoyle/replace-window-turbo-access-…

    …from-fetch
    
    Restructure to avoid internal `window.Turbo` access
    jorgemanrubia authored Nov 27, 2023
    Configuration menu
    Copy the full SHA
    5d7ff7c View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2023

  1. Include idiomorph as a dev dependency (#1086)

    The library is bundled within Turbo so there's no need for apps using
    Turbo to install it.
    Alberto Fernández-Capel authored Nov 29, 2023
    Configuration menu
    Copy the full SHA
    f92fb0f View commit details
    Browse the repository at this point in the history

Commits on Dec 1, 2023

  1. Import session instead of reading window.Turbo.session

    Follow-up to [#1049][]
    Follow-up to [#1073][]
    Related to [#1078][]
    
    Replace an internal `window.Turbo.session` access with an `import {
    session }` statement.
    
    Prior attempts at this change introduced circular dependencies. This
    attempt does not. Additionally, this change maintains the ability for
    consumers to access StreamActions through `window.Turbo.StreamActions`,
    while also enabling `import { StreamActions } from "@hotwired/turbo"`
    (or `from "@hotwired/turbo-rails"`).
    
    [#1049]: #1049
    [#1073]: #1073
    [#1078]: #1078
    seanpdoyle committed Dec 1, 2023
    Configuration menu
    Copy the full SHA
    7a7c6e2 View commit details
    Browse the repository at this point in the history

Commits on Dec 2, 2023

  1. Merge pull request #1094 from seanpdoyle/remove-window-turbo-reference

    Import `session` instead of reading `window.Turbo.session`
    jorgemanrubia authored Dec 2, 2023
    Configuration menu
    Copy the full SHA
    5c48398 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b95162f View commit details
    Browse the repository at this point in the history

Commits on Dec 4, 2023

  1. Communicate Visit direction with html[data-turbo-visit-direction] (#…

    …1007)
    
    * Add direction detail to turbo:visit events
    
    * Test restorationIndex is persisted between reloads
    
    * Add data-turbo-visit-direction to html element
    
    * Versatile Visit direction API.
    Use html[data-turbo-visit-direction] attribute to communicate visit direction rather than using an event detail
    
    * Remove "test" prefix from test description
    
    * Fix typos
    
    * Remove "test" prefix from test description
    
    * Clean up assertions
    
    * Read the mutation logs to assert the direction attribute change
    
    It's less dependent on the timing of the mutation. Even if the attribute
    is no longer present, we can still assert that it was present at some
    point.
    
    ---------
    
    Co-authored-by: Alberto Fernández-Capel <afcapel@gmail.com>
    domchristie and afcapel authored Dec 4, 2023
    Configuration menu
    Copy the full SHA
    ac00359 View commit details
    Browse the repository at this point in the history

Commits on Dec 7, 2023

  1. Merge pull request #1096 from hotwired/scroll-only-page-refresh

    Don't preserve scroll position unless it's a page refresh
    jorgemanrubia authored Dec 7, 2023
    Configuration menu
    Copy the full SHA
    b493fca View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1079 from brunoprietog/use-pathname-for-refreshes

    Page refreshes: Use pathname instead of href to detect if locations are equal
    jorgemanrubia authored Dec 7, 2023
    Configuration menu
    Copy the full SHA
    06ee1fe View commit details
    Browse the repository at this point in the history
  3. Replace remaining calls to nextAnimationFrame by nextRepaint (#1102)

    This ensures that page refreshes work properly when the page is in the background.
    brunoprietog authored Dec 7, 2023
    Configuration menu
    Copy the full SHA
    db310ef View commit details
    Browse the repository at this point in the history

Commits on Dec 8, 2023

  1. Guard [data-turbo-preload] with conditionals (#1033)

    Prior to this change, _any_ `<a>` element with `[data-turbo-preload]`
    would be preloaded. With that behavior comes some risk:
    
    * if an element is nested within a `[data-turbo="false"]` element, the
      preloading would occur unnecessarily
    * if an element has `[data-turbo-stream]`, the preloaded request won't
      be the same as the ensuing request due to differences in the `Accept:`
      header
    * if an element has `[data-turbo-method]`, the preloaded request won't
      be the same as the ensuing request due to differences in the method
    * if an element is within a `<turbo-frame>` or driving a frame via
      `[data-turbo-frame]`, the preloaded request won't be the same as the
      ensuing request due to differences in the `Turbo-Frame:` header
    
    This commit extends the `Preloader` delegate interface to include a
    `shouldPreloadLink(link: HTMLAnchorElement)` predicate method to give
    delegates an opportunity to opt-out of preloading. The `Session`
    implementation of the delegate class adds rejects `<a>` elements that
    match any of those cases.
    
    Co-authored-by: Julian Rubisch <julian@julianrubisch.at>
    seanpdoyle and julianrubisch authored Dec 8, 2023
    Configuration menu
    Copy the full SHA
    098aafc View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2023

  1. Dispatch turbo:before-fetch-{request,response} during preloading (#…

    …1034)
    
    Closes [#963][]
    
    Replace the raw call to `fetch` with a new `FetchRequest` instance that
    treats the `Preloaded` instances as its delegate. During that request's
    lifecycle, dispatch the `turbo:before-fetch-request` and
    `turbo:before-fetch-response` events with the `<a>` element as its
    target.
    
    Prepare the request with the [Sec-Purpose][] header in the
    `prepareRequest` delegate callback.
    
    Write to the snapshot cache from within the
    `requestSucceededWithResponse` delegate callback.
    
    [#963]: #963
    [Sec-Purpose]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Purpose#prefetch
    seanpdoyle authored Dec 14, 2023
    Configuration menu
    Copy the full SHA
    af16eee View commit details
    Browse the repository at this point in the history

Commits on Dec 18, 2023

  1. Set aria-busy on the form element during a form submission (#1110)

    This is useful for styling the form while it is submitting.
    
    Before this change, we were only setting aria-busy on frames while they
    were loading and on the html element while Turbo was processing a visit.
    Alberto Fernández-Capel authored Dec 18, 2023
    Configuration menu
    Copy the full SHA
    df7f982 View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2023

  1. Turbo 8.0.0-beta.2

    afcapel committed Dec 19, 2023
    Configuration menu
    Copy the full SHA
    2a638e0 View commit details
    Browse the repository at this point in the history
Loading
0