Closed BenjaminLesne closed 10 months ago
Latest commit: 4335eba24346c9b68b79d167976e44ad45dd75bc
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The biggest drawback of having this script is not so much HydrationOverlay
, but rather the (webpack) plugin that injects a script into the entry point. That would add client-side logic on hydration that could potentially alter SEO scores, etc.
So if you want to add a conditional, it would be in the plugin logic to disable altering webpack.entry
in production...which you can't do as an end-user without us adding a prop.
Hence why I opted to just have a warning, but not an error, in case the user is purposely leaving the plugin in production.
@samijaber Oh yeh I completely forgot about that... So how am I suppose to handle that right now? Manually remove the plugin from my config before building?
if you want to add a conditional, it would be in the plugin logic to disable altering webpack.entry in production...which you can't do as an end-user without us adding a prop
Is adding that prop problematic?
Sorry for all those questions, I'm just trying to understand. I would love to contribute to this library!
Your options:
HydrationOverlay
, and might impact SEO/page-load since there is a (super super tiny) script that executes on hydration.stripInProduction
config to the plugin that:
stripInProduction === true
+ we are in productionHydrationOverlay
, and does not render <Overlay />
if stripInProduction === true
+ we are in production. I am not 100% sure if that will reduce bundle size as intended, might depend on the bundler of your webapp.I'm lacking of time to do this feature I'm closing it
Currently, the README says we should not use the HydrationOverlay in production but do not show any example of how to deactivate it in production.
I use this conditional provider for HydrationOverlay in my app. I thought I could share it :shrug: