@oxy.so/app-preset 3.6.0 → 3.6.1
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 +7 -0
- package/metro/static-hydration/renderer.js +13 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -57,6 +57,13 @@ older Expo apps when the adapter is off. Review/remove the adapter when Expo
|
|
|
57
57
|
fixes the app/document render boundary upstream. The adapted Expo code retains
|
|
58
58
|
its MIT license in `metro/static-hydration/EXPO-LICENSE`.
|
|
59
59
|
|
|
60
|
+
Development uses the same boundary when starting Expo with
|
|
61
|
+
`EXPO_WEB_DEV_HYDRATE=1`. Expo otherwise calls `createRoot`, replacing its server
|
|
62
|
+
markup rather than hydrating it. In development the adapter also uses Expo's
|
|
63
|
+
actual web `withDevTools` wrapper: its refresh indicator is initially invisible,
|
|
64
|
+
but its sibling still changes React's `useId` paths. Production does not include
|
|
65
|
+
that wrapper. Keep Fast Refresh enabled; do not compensate for IDs in app code.
|
|
66
|
+
|
|
60
67
|
Verify production exports, not just Metro development: JavaScript-disabled
|
|
61
68
|
screenshots must show real chrome, and hydration must retain the same workspace
|
|
62
69
|
DOM node without recoverable React errors. The package tests exercise real
|
|
@@ -23,6 +23,18 @@ const { renderHydratableDocument } = require('./render-document');
|
|
|
23
23
|
|
|
24
24
|
const h = React.createElement;
|
|
25
25
|
|
|
26
|
+
function StaticApp({ headContext, loadedData, element }) {
|
|
27
|
+
return h(Head.Provider, { context: headContext }, h(InnerRoot, { loadedData }, element));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Expo's web entry wraps the entire qualified app in development. Its sibling
|
|
31
|
+
// DevLoadingView participates in React's useId tree even while it renders null.
|
|
32
|
+
// Use the real wrapper on the server too, rather than compensating for its IDs.
|
|
33
|
+
const StaticAppRoot =
|
|
34
|
+
process.env.NODE_ENV !== 'production'
|
|
35
|
+
? require('expo/build/launch/withDevTools.web').withDevTools(StaticApp)
|
|
36
|
+
: StaticApp;
|
|
37
|
+
|
|
26
38
|
function getStreamingContent(location, options) {
|
|
27
39
|
if (options?.output !== 'static') return original.getStreamingContent(location, options);
|
|
28
40
|
return fonts.withServerContext(async () => {
|
|
@@ -38,7 +50,7 @@ function getStreamingContent(location, options) {
|
|
|
38
50
|
globalThis.__react_navigation__elements_contexts = new Map();
|
|
39
51
|
const loaderKey = options.loader ? options.loader.key + location.search : null;
|
|
40
52
|
const loadedData = loaderKey ? { [loaderKey]: options.loader.data ?? null } : null;
|
|
41
|
-
const app = h(
|
|
53
|
+
const app = h(StaticAppRoot, { headContext, loadedData, element });
|
|
42
54
|
|
|
43
55
|
const html = await renderHydratableDocument(
|
|
44
56
|
app,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxy.so/app-preset",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.1",
|
|
4
4
|
"description": "The Oxy distro of Expo — centralized Expo config plugin, Metro/Babel/ESLint factories, Tailwind base CSS and TypeScript bases shared by every Oxy app (Mention, Homiio, Allo, accounts, …). A zero-build package: apps replace copy-pasted config with a single dependency bump.",
|
|
5
5
|
"main": "./app.plugin.js",
|
|
6
6
|
"publishConfig": {
|