Comments (5)
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.
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.
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.
@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.
@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)
- Javascript functions doesn't works on the second time HOT 1
- Locomotive scroll not updating after page transition HOT 3
- I can't get the HIGHWAY.redirect() to work HOT 1
- Updating CSS for incoming page – (Highway maintains the outgoing page's CSS) HOT 5
- data-transition attribute no longer works in 2.2.2 HOT 2
- Update /refresh/bind links dynamically created with javascript HOT 1
- New href with highway HOT 13
- Adding additional headers to page requests
- Add index.d.ts file for better IDE typehinting
- back/forward buttons pressed during transition break the website
- Facebook Pixel Tracking HOT 3
- Fatal error on transition to mismatching URL scheme, while remaining on the same domain
- Can't work with CDN
- Improper use of DOM events
- Highway not working with DOM elements rendered by javascript HOT 1
- H.redirect always refresh page HOT 1
- Help
- H is undefined HOT 1
- Navigation with parameters and anchor not working
- Javascript not working after page transition HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from highway.