IntersectionObserver VS turbo

Compare IntersectionObserver vs turbo and see what are their differences.

turbo

The speed of a single-page web application without having to write any JavaScript (by hotwired)
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
IntersectionObserver turbo
6 145
3,621 6,424
0.1% 0.9%
5.0 8.7
about 2 months ago 13 days ago
Bikeshed JavaScript
GNU General Public License v3.0 or later MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

IntersectionObserver

Posts with mentions or reviews of IntersectionObserver. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-07-28.
  • Lazy loading of images in masonry layout?
    1 project | /r/nicegui | 7 Jul 2023
    You should only create the images (or set the src) for the images which are visible to the user. See our infinite scroll example for a naive implementation. More elaborated code might use the https://www.w3.org/TR/intersection-observer/.
  • Safari isn't protecting the web, it's killing it
    3 projects | news.ycombinator.com | 28 Jul 2021
    I got a little curious on the statuses of these standards and went on a bit of searching.

    > CSS contain (CSS Containment Module Level 2) - First published in 2019, still Editor's Draft[1]. Not supported by Safari/WebKit.

    > CSS offset-path (Motion Path Module Level 1) - First published in 2015, still Editor's Draft[2]. Not supported by Safari/WebKit.

    > CSS overflow-anchor (CSS Scroll Anchoring Module Level 1) - First published in 2020, still Editor's Draft[3]. Not supported by Safari/WebKit.

    > Resolution media queries (dppx) - W3C Recommendation since 2012[4]. Not supported by Safari/WebKit.

    > :focus-visible (Selectors Level 4) - First published in 2011, still Editor's Draft[5]. Not supported by Safari/WebKit.

    - Touch Events - W3C Recommendation since 2013[6]. Supported on iOS 3.2 (2010). I assume the author meant Pointer Events[7] which became W3C recommendation since 2019, and supported on 13.2 (2019).

    > BroadcastChannel - WHATWG Living Standard[8]. Blocked by privacy concern on WebKit side since 2020[9]. Initial support landed in WebKit trunk as of 2021-07.[10]

    > beforeprint/afterprint - WHATWG Living Standard[11]. Supported by Safari/WebKit since 2019 (iOS 13).

    > Regex Lookbehind - ECMAScript 2018[12]. Not supported by Safari/WebKit.

    > scrollIntoView (CSSOM View Module) - First introduced in CSSOM View Module since 2011, still Editor's Draft[13]. Not supported by Safari/WebKit.

    > Screen Orientation API - First committed in wc3/screen-orientation in 2012, still a W3C Working Draft[14]. Not supported by Safari/WebKit.

    > Date and time input types - WHATWG Living Standard[15], partial support by Safari/WebKit since 2012 (iOS 5) but no week/min/max.

    > Service Workers - W3C Candidate Recommendation since 2019[16]. Supported by Safari/WebKit since 2018 (iOS 14.5).

    - AbortSignal - WHATWG Living Standard[17]. Supported by Safari/WebKit since 2018 (iOS 11.3)

    - Intersection Observer - First published in 2017, still W3C Working Draft[18]. Supported by Safari/WebKit since 2019 (iOS 12.2).

    - Client-side form validation - WHATWG Living Standard[19]. Supported by Safari/WebKit since 2017 (iOS 10.3).

    [1]: https://drafts.csswg.org/css-contain/#contain-property

    [2]: https://drafts.fxtf.org/motion/#offset-path-property

    [3]: https://drafts.csswg.org/css-scroll-anchoring/#exclusion-api

    [4]: https://www.w3.org/TR/css3-mediaqueries/#resolution

    [5]: https://drafts.csswg.org/selectors-4/#the-focus-visible-pseu...

    [6]: https://www.w3.org/TR/touch-events/

    [7]: https://www.w3.org/TR/pointerevents/

    [8]: https://html.spec.whatwg.org/multipage/web-messaging.html#br...

    [9]: https://github.com/whatwg/html/issues/5803

    [10]: https://bugs.webkit.org/show_bug.cgi?id=227924

    [11]: https://html.spec.whatwg.org/multipage/timers-and-user-promp...

    [12]: https://262.ecma-international.org/9.0/

    [13]: https://drafts.csswg.org/cssom-view/#dom-element-scrollintov...

    [14]: https://www.w3.org/TR/screen-orientation/

    [15]: https://html.spec.whatwg.org/multipage/input.html#date-state...

    [16]: https://www.w3.org/TR/service-workers/

    [17]: https://dom.spec.whatwg.org/#abortsignal

    [18]: https://www.w3.org/TR/intersection-observer/

    [19]: https://html.spec.whatwg.org/multipage/forms.html#client-sid...

  • Revealing Contents on Scroll Using JavaScript’s Intersection Observer API
    2 projects | dev.to | 22 May 2021
    W3.Org
  • Adding IntersectionObserver polyfill
    1 project | /r/nextjs | 5 May 2021
    I've used https://github.com/w3c/IntersectionObserver/tree/main/polyfill in the past and it's pretty much just import and forget.
  • Endless Scroll / Infinite Loading with Turbo Streams & Stimulus
    4 projects | dev.to | 3 May 2021
    // app/javascript/controllers/infinite_scoll_controller.js import { Controller } from "stimulus" export default class extends Controller { static targets = ["scrollArea", "pagination"] connect() { this.createObserver() } createObserver() { const observer = new IntersectionObserver( entries => this.handleIntersect(entries), { // https://github.com/w3c/IntersectionObserver/issues/124#issuecomment-476026505 threshold: [0, 1.0], } ) observer.observe(this.scrollAreaTarget) } handleIntersect(entries) { entries.forEach(entry => { if (entry.isIntersecting) { this.loadMore() } }) } loadMore() { const next = this.paginationTarget.querySelector("[rel=next]") if (!next) { return } const href = next.href fetch(href, { headers: { Accept: "text/vnd.turbo-stream.html", }, }) .then(r => r.text()) .then(html => Turbo.renderStreamMessage(html)) .then(_ => history.replaceState(history.state, "", href)) } }
  • Create an infinite scrolling blog roll in Rails with Hotwire
    2 projects | dev.to | 22 Mar 2021
    import { Controller } from "stimulus" export default class extends Controller { static targets = ["entry"] static values = { path: String, } connect() { this.createObserver(); } createObserver() { let observer; let options = { // https://github.com/w3c/IntersectionObserver/issues/124#issuecomment-476026505 threshold: [0, 1.0] }; observer = new IntersectionObserver(entries => this.handleIntersect(entries), options); observer.observe(this.entryTarget); } handleIntersect(entries) { entries.forEach(entry => { if (entry.isIntersecting) { // https://github.com/turbolinks/turbolinks/issues/219#issuecomment-376973429 history.replaceState(history.state, "", this.pathValue); } }); } }

turbo

Posts with mentions or reviews of turbo. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-27.
  • Turbo Streaming Modals in Ruby on Rails
    4 projects | dev.to | 27 Mar 2024
    I also recommend checking out the docs for Stimulus and Turbo to familiarise yourself with all their features and the APIs used in this series.
  • Htmx vs. React: A Complete Comparison – Semaphore
    2 projects | news.ycombinator.com | 22 Feb 2024
    https://github.com/hotwired/turbo
  • Turbo 8 has been released
    1 project | news.ycombinator.com | 7 Feb 2024
  • What is JSDoc and why you may not need typescript for your next project?
    8 projects | dev.to | 22 Jan 2024
    Turbo 8 remove typescript without using JSDOC
  • Coming to grips with JS: a Rubyist's deep dive
    16 projects | dev.to | 29 Dec 2023
    Experiment using Turbo to drive front-end behavior: "Turbo 7.2.0 (currently in beta) allows you to define your own Stream actions which can be any JS code you want. By combining a custom Stream action or two with web components, you can essentially drive reactive frontend behavior from the backend stupidly easily. Loooove it! 😍 […] For a turnkey example, you could check out https://github.com/hopsoft/turbo_ready " —Jared White on The Spicy Web Discord
  • Improving a web component, one step at a time
    4 projects | dev.to | 16 Dec 2023
    This handles disconnection (as could be done by any destructive change to the DOM, like navigating with Turbo or htmx, I'm not even talking about using the element in a JavaScript-heavy web app) but not reconnection though, and we've exited early from the connectedCallback to avoid initializing the element twice, so this change actually broke our component in these situations where it's moved around, or stashed and then reinserted. To fix that, we need to always call addSparkles in connectedCallback, so move all the rest into an if, that's actually as simple as that… except that when the user prefers reduced motion, sparkles are never removed, so they keep piling in each time the element is connected again. One way to handle that, without introducing our housekeeping of individual timers, is to just remove all sparkles on disconnection. Either that or conditionally add them in connectedCallback if either we're initializing the element (including attaching the shadow DOM) or the user doesn't prefer reduced motion. The difference between both approaches is in whether we want the small animation when the sparkles appear (and appearing at new random locations). I went with the latter.
  • Mastering Rails Web Navigation with link_to and button_to Helpers - Part 2
    4 projects | dev.to | 22 Oct 2023
    If you think you have seen enough Rails magic, you are mistaken my friend. Rails have a new trick up its sleeve: Hotwire. And with the magical Turbo tool that comes with it, you can create modern, interactive web applications with minimal, or sometimes no JavaScript at all, providing users with an incredibly smooth experience.
  • Why you should choose HTMX for your next project
    2 projects | dev.to | 19 Oct 2023
    There is also Turbo and the frameworks who adopt them, Ruby on Rails, PHP Symphony and possibly others that solves the same issue in the same manner as HTMX. And the choice for HTMX is only a personal taste in this, but you should definitely learn about this, this is as cool as HTMX!
  • JavaScript First, Then TypeScript
    5 projects | dev.to | 15 Oct 2023
    Most controversially, the Turbo framework dropped TypeScript support altogether after assessing that strong typing was the culprit behind poor developer experience.
  • Rack Attack – Rails Tricks
    1 project | news.ycombinator.com | 13 Oct 2023
    Turbo[0] has been solving this for years. Quite the contrary, front-end frameworks have started to think "sending JSON is good, but actually sending HTML could be great!".

    DHH's presentation[1] during Rails World 2023 is quite interesting in that regard, I recommend you give it a go (start around minute 16). I am actually very excited with his vision of the web.

    [0] https://turbo.hotwired.dev/