You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current solution is great, but not great-great for server side - while reactive approach is good for SPA, adaptive might be a better choice for SSR.
Actually - this is not a good idea to ship two different code variants, but - sometimes there is no choice
Idea:
add a flag to Matcher, to wrap every media result with media guard, which would display such result in case of media match
add a flag to Matcher, to return more than than(up to all) result. That would lead to adaptive layout.
add a flag to Matcher, for else condition, displaying provided failback if the main condition is not met.
(bonus) measure branches size, and warn if too many data got rendered.
<Matcheradaptivemobile="mobile"tablet="tablet">
// probably some user-provided className should be set to the adaptive div.
<divclass='media-adaptive-mobile'>mobile</div><divclass='media-adaptive-tablet'>tablet</div>
The current solution is great, but not great-great for server side - while reactive approach is good for SPA, adaptive might be a better choice for SSR.
Idea:
Matcher
, to wrap every media result withmedia guard
, which would display such result in case of media matchMatcher
, to return more than than(up to all) result. That would lead to adaptive layout.Matcher
, forelse
condition, displaying providedfailback
if the main condition is not met.Then -
failback-div
could use standard responsive things do adapt placeholder for a right media, untill hydration.That would make media matcher SSR friendly for the cases of client-side javascript disabled, or just lower TTI.
The text was updated successfully, but these errors were encountered: