@variantlab/core 0.1.9 → 0.1.10
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/README.md +2 -2
- package/docs/features/debug-overlay.md +4 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1024,7 +1024,7 @@ export function createSecureStoreAdapter(): Storage;
|
|
|
1024
1024
|
|
|
1025
1025
|
```tsx
|
|
1026
1026
|
export const VariantDebugOverlay: React.FC<{
|
|
1027
|
-
|
|
1027
|
+
enabled?: boolean;
|
|
1028
1028
|
routeFilter?: boolean;
|
|
1029
1029
|
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
1030
1030
|
hideButton?: boolean;
|
|
@@ -1038,7 +1038,7 @@ export function closeDebugOverlay(): void;
|
|
|
1038
1038
|
|
|
1039
1039
|
```tsx
|
|
1040
1040
|
export const VariantDebugOverlay: React.FC<{
|
|
1041
|
-
|
|
1041
|
+
enabled?: boolean;
|
|
1042
1042
|
routeFilter?: boolean;
|
|
1043
1043
|
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
1044
1044
|
hideButton?: boolean;
|
|
@@ -87,29 +87,11 @@ When no experiments match the current route:
|
|
|
87
87
|
|
|
88
88
|
## Production safety
|
|
89
89
|
|
|
90
|
-
The overlay
|
|
91
|
-
|
|
92
|
-
### Auto-disable in production
|
|
93
|
-
|
|
94
|
-
The overlay component checks multiple signals before rendering:
|
|
90
|
+
The overlay renders by default when mounted. Pass `enabled={false}` to hide it:
|
|
95
91
|
|
|
96
92
|
```tsx
|
|
97
|
-
function VariantDebugOverlay({
|
|
98
|
-
|
|
99
|
-
forceEnable ||
|
|
100
|
-
(typeof __DEV__ !== "undefined" && __DEV__) ||
|
|
101
|
-
process.env.NODE_ENV === "development";
|
|
102
|
-
|
|
103
|
-
if (!isDev) {
|
|
104
|
-
if (process.env.NODE_ENV === "production") {
|
|
105
|
-
console.warn(
|
|
106
|
-
"[variantlab] VariantDebugOverlay rendered in production. " +
|
|
107
|
-
"Use forceEnable={true} if this is intentional.",
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
return null;
|
|
111
|
-
}
|
|
112
|
-
|
|
93
|
+
function VariantDebugOverlay({ enabled = true }) {
|
|
94
|
+
if (enabled === false) return null;
|
|
113
95
|
return <OverlayImpl />;
|
|
114
96
|
}
|
|
115
97
|
```
|
|
@@ -166,7 +148,7 @@ Advanced: a 4-corner tap sequence in a specific order. Useful for hiding the ove
|
|
|
166
148
|
|
|
167
149
|
### URL parameter (web only)
|
|
168
150
|
|
|
169
|
-
Append `?__variantlab=1` to the URL to
|
|
151
|
+
Append `?__variantlab=1` to the URL to open the overlay programmatically.
|
|
170
152
|
|
|
171
153
|
---
|
|
172
154
|
|