@hook-sdk/template 0.23.1 → 0.23.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -17
- package/dist/index.d.ts +18 -17
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -208,26 +208,27 @@ type AppRootProps = AppRootSlots & {
|
|
|
208
208
|
declare function AppRoot(props: AppRootProps): react_jsx_runtime.JSX.Element;
|
|
209
209
|
|
|
210
210
|
/**
|
|
211
|
-
*
|
|
211
|
+
* Runtime gate for dev-only tools (e.g. <DevSkipOnboardingFab>).
|
|
212
212
|
*
|
|
213
|
-
*
|
|
213
|
+
* History:
|
|
214
|
+
* v0.23.0 / v0.23.1 also gated on `import.meta.env.VITE_HOOK_DEV_TOOLS`.
|
|
215
|
+
* That was intended as a build-time DCE signal so the dev module would
|
|
216
|
+
* tree-shake out of prod bundles. Empirically vite's static replacement
|
|
217
|
+
* does NOT apply to template code consumed from node_modules when the
|
|
218
|
+
* creator app uses `build.lib` mode — every consumer ended up with
|
|
219
|
+
* `undefined !== '1'` → DCE killed the FAB from STAGING bundles too.
|
|
214
220
|
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
221
|
+
* Pragmatic fix: drop the env gate and rely on the runtime hostname
|
|
222
|
+
* check alone. The FAB code now ships in prod bundles too (~5 KB), but
|
|
223
|
+
* it never renders on prod hostnames because `.staging.` / `localhost`
|
|
224
|
+
* is the only path that returns `true`. Visual safety = hostname check
|
|
225
|
+
* at render. Compliance / privacy = no real user can ever trigger the
|
|
226
|
+
* auto-signup branch on a `usehook.net` (prod) origin.
|
|
219
227
|
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
* `import.meta.env.VITE_HOOK_DEV_TOOLS`. Vite's static replacement is a
|
|
225
|
-
* text substitution that only fires on this exact form. Going through a
|
|
226
|
-
* local alias (`const meta = import.meta; meta.env.X`) defeats the
|
|
227
|
-
* substitution and the consumer bundle ends up with `undefined` regardless
|
|
228
|
-
* of what the build env actually has set. See `../vite-env.d.ts` for the
|
|
229
|
-
* ambient ImportMeta augmentation that keeps TypeScript happy without a
|
|
230
|
-
* cast at the access site.
|
|
228
|
+
* If a creator app wants the build-time DCE back, the consumer's
|
|
229
|
+
* `vite.config.ts` `define` block must explicitly substitute
|
|
230
|
+
* `import.meta.env.VITE_HOOK_DEV_TOOLS` — vite's auto-replacement skips
|
|
231
|
+
* `node_modules` in lib mode.
|
|
231
232
|
*/
|
|
232
233
|
declare function isDevToolsEnabled(): boolean;
|
|
233
234
|
|
package/dist/index.d.ts
CHANGED
|
@@ -208,26 +208,27 @@ type AppRootProps = AppRootSlots & {
|
|
|
208
208
|
declare function AppRoot(props: AppRootProps): react_jsx_runtime.JSX.Element;
|
|
209
209
|
|
|
210
210
|
/**
|
|
211
|
-
*
|
|
211
|
+
* Runtime gate for dev-only tools (e.g. <DevSkipOnboardingFab>).
|
|
212
212
|
*
|
|
213
|
-
*
|
|
213
|
+
* History:
|
|
214
|
+
* v0.23.0 / v0.23.1 also gated on `import.meta.env.VITE_HOOK_DEV_TOOLS`.
|
|
215
|
+
* That was intended as a build-time DCE signal so the dev module would
|
|
216
|
+
* tree-shake out of prod bundles. Empirically vite's static replacement
|
|
217
|
+
* does NOT apply to template code consumed from node_modules when the
|
|
218
|
+
* creator app uses `build.lib` mode — every consumer ended up with
|
|
219
|
+
* `undefined !== '1'` → DCE killed the FAB from STAGING bundles too.
|
|
214
220
|
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
221
|
+
* Pragmatic fix: drop the env gate and rely on the runtime hostname
|
|
222
|
+
* check alone. The FAB code now ships in prod bundles too (~5 KB), but
|
|
223
|
+
* it never renders on prod hostnames because `.staging.` / `localhost`
|
|
224
|
+
* is the only path that returns `true`. Visual safety = hostname check
|
|
225
|
+
* at render. Compliance / privacy = no real user can ever trigger the
|
|
226
|
+
* auto-signup branch on a `usehook.net` (prod) origin.
|
|
219
227
|
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
* `import.meta.env.VITE_HOOK_DEV_TOOLS`. Vite's static replacement is a
|
|
225
|
-
* text substitution that only fires on this exact form. Going through a
|
|
226
|
-
* local alias (`const meta = import.meta; meta.env.X`) defeats the
|
|
227
|
-
* substitution and the consumer bundle ends up with `undefined` regardless
|
|
228
|
-
* of what the build env actually has set. See `../vite-env.d.ts` for the
|
|
229
|
-
* ambient ImportMeta augmentation that keeps TypeScript happy without a
|
|
230
|
-
* cast at the access site.
|
|
228
|
+
* If a creator app wants the build-time DCE back, the consumer's
|
|
229
|
+
* `vite.config.ts` `define` block must explicitly substitute
|
|
230
|
+
* `import.meta.env.VITE_HOOK_DEV_TOOLS` — vite's auto-replacement skips
|
|
231
|
+
* `node_modules` in lib mode.
|
|
231
232
|
*/
|
|
232
233
|
declare function isDevToolsEnabled(): boolean;
|
|
233
234
|
|
package/dist/index.js
CHANGED
|
@@ -2099,10 +2099,9 @@ function I18nProvider({
|
|
|
2099
2099
|
|
|
2100
2100
|
// src/dev/env.ts
|
|
2101
2101
|
function isDevToolsEnabled() {
|
|
2102
|
-
if (import.meta.env.VITE_HOOK_DEV_TOOLS !== "1") return false;
|
|
2103
2102
|
if (typeof window === "undefined") return false;
|
|
2104
2103
|
const host = window.location.hostname;
|
|
2105
|
-
return host.includes("
|
|
2104
|
+
return host.includes("staging.usehook.net") || host === "localhost" || host === "127.0.0.1";
|
|
2106
2105
|
}
|
|
2107
2106
|
|
|
2108
2107
|
// src/dev/DevSkipOnboardingFab.tsx
|