Git Product home page Git Product logo

Comments (5)

Anthodpnt avatar Anthodpnt commented on August 9, 2024 2

Hi @Michkkael,

Thanks for the suggestion!
You're right it might be interesting to extend the transition feature and cover even more use cases.
We'll think about it for the v2.0.0 that's in beta for now and keep you in touch.

About the prefetching, it's really the worst way of doing it in Barba.js. It doesn't make sense to prefetch a page when a user hovers un link since users might hover links either by mistake or without clicking them. This means you're doing HTTP requests without being a bit sure the user will do anything.

Another more efficient way to do it would be to use a library like Premonish to try to predict if the user intent to click an element or not based on the intention score.

The problem is that it would add an extra layer of weight and complexity to our library that we want to keep simple to use. So we are not closing the door this the prefetch feature but it needs time to be done intelligently and efficiently. We will think about it for a later major release maybe.

Best regards,
Anthodpnt

from highway.

Anthodpnt avatar Anthodpnt commented on August 9, 2024 1

We took a look for a solution to improve the way transitions are working but we couldn't find the cleanest and most effective one for now. One lead would be to send in the transitions the name of the view we come from or we go to in order to use this information and create some conditional statements inside the transition itself, but it's not possible for now.

Right now the out method of the transition is called in parallel of the fetching of the view we are going to so we don't know the name given to this one until the fetch is resolved and we get the DOM. This means we cannot send this information in the out transition for example.

We keep this request pending for now and we are closing the issue since no right solution seems to be available for now...

from highway.

mikehwagz avatar mikehwagz commented on August 9, 2024 1

I would also really love a feature like this. I've achieved something similar using Barba.js (described here), but similar to Highway, the correct transition can only be determined after the new view is fetched, and I understand it is not ideal to make the user wait for the fetch to complete before beginning the transition out.

I wanted to chime in here since this is somewhat related to our discussion regarding overlapping transitions as both features would require the new view to be fetched before beginning the transition out.

from highway.

mickaelchanrion avatar mickaelchanrion commented on August 9, 2024

@mikehwagz BTW, thanks a lot for this reducer. I used it for a project, it works like a charm!
You're right it's not ideal because of what you are pointing. But I don't see other good solutions.

An other solution would be to have an idea of the name of the view we're going to load. For instance:
<a href="route/to/projects/view" data-view="projects">Projects</a>
But it's not convenient at all. :/

from highway.

mikehwagz avatar mikehwagz commented on August 9, 2024

@Michkkael of course! glad that helped you out.

Yea, the solution you've proposed would definitely work in certain cases, but not in all cases (for example a link created within a WordPress WYSIWYG field).

from highway.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.