Closed hirasso closed 1 year ago
I'm assuming I'm not supposed to look at this yet? Ping me when it's finished π
pong π π
Just to understand β what's the weirdness you've been seeing? Buggy behaviour or difficulties with logging/debugging?
I agree that warning about fragments outside of swup containers is useful, but is there a benefit to absolutely ignoring those fragments instead of merely warning about them? I'm mostly thinking of modals/popups that need to live outside a swup container for styling/accessibility reasons.
@daun Thanks for asking! :)
The thing I was seeing:
I'm almost 100% percent sure that there will never be a fragment outside of swup's default containers necessary. But I'm happy to be convinced otherwise. Due to the complexity of the subject I'd love to get together in a call and talk it through.
Sure, let's talk it through in a call soon! If you're seeing the issue in the exact case I'm imagining as a counter-point, I'm probably not seeing the whole picture yet.
Description
I recently got bitten by the fact that I had fragments defined that were outside of swup's
options.containers
. This lead to hard-to-understand weirdness between normal and fragment visits.This PR adds validation so that each fragment for a visit must meet one of these two rules:
Otherwise the fragment rule will be ignored for the current visit.
How to test:
Markup:
JS:
Checks
master
branchnpm run lint
)