This PR extends replaces reading of the data-rehydratable attribute with a query selector. By default, this query selector will check for data-rehydratable, but this can be overridden using the getQuerySelector param.
You can get quite creative with your selectors, targeting whatever you want.
Breaking changes
This PR contains no breaking changes
Considerations
There is a slight performance penalty to doing this instead of reading the data-rehydratable attribute directly, in particular due to the introduction of some new loops. I'll do my best to point them out via PR line comments.
Blocked by #48, and have based this on that.
What?
Enables custom query selectors, which can eliminate any custom markup.
Instead of this
You can now have this
By configuring your rehydrate method with the new
getQuerySelector()
methodHow?
This PR extends replaces reading of the
data-rehydratable
attribute with a query selector. By default, this query selector will check fordata-rehydratable
, but this can be overridden using thegetQuerySelector
param.You can get quite creative with your selectors, targeting whatever you want.
Breaking changes
This PR contains no breaking changes
Considerations
There is a slight performance penalty to doing this instead of reading the
data-rehydratable
attribute directly, in particular due to the introduction of some new loops. I'll do my best to point them out via PR line comments.TODO