swup / fragment-plugin

A swup plugin for dynamically replacing containers based on rules 🧩
https://swup-fragment-plugin.netlify.app
MIT License
15 stars 1 forks source link

feat : check for missing fragment elements #48

Closed hirasso closed 11 months ago

hirasso commented 11 months ago

Description

Introduces a check while matching fragment rules, that validates if any of the selectors in rule.containers doesn't return a match in the current document. If so, the rule will be skipped for the current visit.

Makes the PR #47 unnecessary for the use case I'm facing right now. I'd like to keep the rule API surface as small as possible until we stumble on a use case where we really need to expand it. We can keep the rule.if PR open and in sync, should we need it sometime.

Checks

daun commented 11 months ago

Is this breaking? Do we care?

hirasso commented 11 months ago

I'd say it's not breaking. IMO it was almost a bug as it was before.

hirasso commented 11 months ago

Sorry, again please 👔