Comments (7)
Would you take a Pull Request for this?
from alpine-turbo-drive-adapter.
Yeah, sure. It may need some thinking and discussion though because it might not be the desired behavior.
For example, a sidebar menu, you click on something, a flag is set to true to show the menu then you click on a link to navigate away, when you navigate back you won't expect the sidebar to be open.
What do you think? Maybe we should cache them only if there is a specific attribute.
from alpine-turbo-drive-adapter.
I actually think in that case the state should be preserved on the back button in that case. I do worry about how it will work with removing Alpine generated DOM nodes.
from alpine-turbo-drive-adapter.
I'm not sure people would agree, if they hit back and a modal was already open, I think they would report it as a bug
from alpine-turbo-drive-adapter.
So, I've been using data-turbolinks-permanent
to preserve client state across navigation, but I can see how the "back button" would semantically be different than clicking on a link ("get me back to my previous state.") In 99% of the cases I suspect that wold be the correct/expected behaviour, but don't think you could add something like this without a way of opting out of it.
from alpine-turbo-drive-adapter.
yeah, I'm not convinced because stuff like modals and submenus could open when you go back menu if you clicked on a link inside them which feels a bit weird. I'm trying to understand if it's perceived as an issue at the moment before doing anything.
As you said, if I ever add anything will be either an opt-out (data-alpine-no_cache) or maybe even an opt-in mechanism so people don't get errors if they update without reading the release notes.
I'm still thinking about it for now.
from alpine-turbo-drive-adapter.
Closing for now. The unexpected side effects are far worse than the benefits.
from alpine-turbo-drive-adapter.
Related Issues (20)
- Missing readme
- Disappearing template loop items HOT 7
- x-for elements disappearing after Livewire rerender HOT 11
- v0.2.0 - x-for loop items disappear HOT 3
- IE 11 support HOT 4
- Turbo Drive compatibility HOT 12
- Issue with data-turbolinks-permanent combined with x-cloak HOT 3
- fail when render status: :unprocessable_entity HOT 32
- Figure out if the plugin is testable somehow HOT 9
- JS file always runs after the turbo:load event, causing x-data to throw a ReferenceError on first navigation HOT 6
- Turbo stream - not initialising HOT 5
- after fired turbo:render x-data not exists HOT 12
- Currently Breaks with Alpine.js & Livewire HOT 14
- Add github action to publish the library on npm when a new version is tagged. HOT 1
- Alpine v3 compatability HOT 36
- How can I keep the cdn link updated HOT 5
- Necessary if caching disabled? HOT 1
- Add npm instructions HOT 3
- Components hidden by default, such as mobile navigation menus, get cached and cause flickering when navigating between pages. HOT 19
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 alpine-turbo-drive-adapter.