Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

More refined transition configuration

See original GitHub issue

Hi! Thank you for this good lib that can replace the good old Barba.js! I’m seeing a use case that Highway cannot cover:

Let’s assume you have this website architecture:


–> It might be interesting to have the ability to have a different ‘in’ transition of the about page depending on where you are coming from.

For example, here is a ‘cheap’ but simple use case (like a slider):

  • If you come from ‘home’, you want that the ‘about’ page slides in from the right.
  • If you come from ‘contact’, you want that the ‘about’ page slides in from the left.

Here is a suggestion about the config:

new Highway.Core({
  transitions: {
    default: Fade,
    home: Home,
    contact: Contact,
    about: {
      home: aboutHome,
      contact: aboutContact,

Or simpler: You just provide additional params in in and out methods of a class Transition. For example, an object as follow:

  from: 'home',
  to: 'about',

PS: The prefetch option was interesting on Barba.js. Are you planing to implement it? 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

Anthodpntcommented, Jun 20, 2018

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

mikehwagzcommented, Sep 19, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

19.1: Properties of Transition Metals and Their Compounds
The transition metals are elements with partially filled d ... configuration makes it the first member of the third transition series.
Read more >
Transition Metals - The Parts of the Periodic Table
The transition elements or transition metals occupy the short columns in the center of ... This is further refined to produce either pure...
Read more >
Transition element - Knowino - Theoretical Chemistry
The electron configuration of transition element atoms contains the orbital occupancy (nd)k, 1 ≤ k ≤ 9, where n is the principal quantum ......
Read more >
Automated exploitation of the big configuration space of large ...
Here, we introduce an automated framework to predict stable configurations on transition metal surfaces and demonstrate its validity for ...
Read more >
Transition Guides - EcoStruxure Security Expert
Transition Reference Guides describe how a legacy system can be transitioned to a new system. Transition Reference Guides provide system integrators with the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found