@oxyhq/bloom 1.9.0 → 1.9.2
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/docs/getting-started.mdx +38 -12
- package/docs/media-flight.mdx +8 -3
- package/lib/commonjs/connection-status/netinfo.js +7 -0
- package/lib/commonjs/connection-status/netinfo.js.map +1 -1
- package/lib/module/connection-status/netinfo.js +7 -0
- package/lib/module/connection-status/netinfo.js.map +1 -1
- package/lib/typescript/commonjs/connection-status/netinfo.d.ts +7 -0
- package/lib/typescript/commonjs/connection-status/netinfo.d.ts.map +1 -1
- package/lib/typescript/module/connection-status/netinfo.d.ts +7 -0
- package/lib/typescript/module/connection-status/netinfo.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/connection-status/netinfo.ts +7 -0
package/docs/getting-started.mdx
CHANGED
|
@@ -71,42 +71,68 @@ optional. Off Metro that load does not deliver the package **even when it is
|
|
|
71
71
|
installed** — and the reason depends on your bundler, which is why this defect
|
|
72
72
|
keeps being diagnosed wrongly:
|
|
73
73
|
|
|
74
|
-
| bundler |
|
|
74
|
+
| bundler | what the guard sees | what happens |
|
|
75
75
|
| --- | --- | --- |
|
|
76
|
-
| Rollup / Vite | `
|
|
77
|
-
| esbuild |
|
|
76
|
+
| Rollup / Vite (classic) | no `require` | the guard degrades |
|
|
77
|
+
| esbuild | a shim that THROWS | the guard passes, the call fails inside the `try` |
|
|
78
|
+
| Vite 8 / Rolldown | `__require`, a Proxy-backed **function** | the guard passes, the call throws `Calling 'require' for "…" in an environment that doesn't expose the 'require' function` |
|
|
78
79
|
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
**Do not test this with `typeof require` in your console.** Measured in a real
|
|
81
|
+
Rolldown app: the console answers `"undefined"` while the COMPILED guard is
|
|
82
|
+
consulting an imported `__require` that is a function — so the one-line check
|
|
83
|
+
reports the first row while the bundle is in the third. It does not distinguish
|
|
84
|
+
the cases, it confuses them. Read the dev warning's `Reason:` instead; it is the
|
|
85
|
+
bundler's own message.
|
|
81
86
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
Metro is unaffected.
|
|
88
|
+
|
|
89
|
+
**On web you lose one thing: `expo-video`.** `MediaSurface` loads it on every
|
|
90
|
+
platform, so a web app that flies video without handing it over gets the poster.
|
|
91
|
+
That is what `provideExpoVideo` below is for.
|
|
92
|
+
|
|
93
|
+
**The connection toasts are NOT affected**, though this guide said they were
|
|
94
|
+
until it was checked: `./connection-status` ships a web implementation
|
|
95
|
+
(`ConnectionStatusToasts.web.tsx`) built on `navigator.onLine` and the
|
|
96
|
+
`online`/`offline` events, so `loadNetInfo` is never called in a browser and
|
|
97
|
+
netinfo need not be installed at all.
|
|
85
98
|
|
|
86
99
|
**The other optional peers are NOT affected on web**, because their callers
|
|
87
100
|
return before the `require` is ever reached:
|
|
88
101
|
|
|
89
102
|
| peer | why web never reaches it |
|
|
90
103
|
| --- | --- |
|
|
104
|
+
| `@react-native-community/netinfo` | the family has a WEB FORK that uses `navigator.onLine` (`connection-status/index.web.ts` → `ConnectionStatusToasts.web.tsx`) |
|
|
91
105
|
| `expo-router` (adaptive colours) | `getAdaptiveColors` returns `null` unless `Platform.OS` is `android`/`ios` (`theme/adaptive-colors.ts:143-145`) |
|
|
92
106
|
| `nativewind` (scoped presets) | both callers `return` on web (`theme/color-scope/style-builder.ts:159, :192`) |
|
|
93
107
|
| `expo-haptics` | `useHaptics` returns on web (`hooks/use-haptics.tsx:47`) |
|
|
94
108
|
|
|
109
|
+
Note the two different reasons: a platform guard inside the file, and a whole
|
|
110
|
+
`.web` fork of the family.
|
|
111
|
+
|
|
112
|
+
> **Before claiming what a consumer loses, check which platform variant their
|
|
113
|
+
> bundler resolves.** This guide named the connection toasts as a casualty
|
|
114
|
+
> because the `.tsx` was read and the `.web.tsx` beside it was not — and the
|
|
115
|
+
> `.web` one had solved the problem months earlier. Reading the source file is
|
|
116
|
+
> not reading the file that runs; the two differ on exactly the axis this
|
|
117
|
+
> section is about. Confirm it from the loaded page
|
|
118
|
+
> (`SomeComponent.toString()`) or from the chunks, not from the repository.
|
|
119
|
+
|
|
95
120
|
If scoped NativeWind presets are wrong in your web app, this is not the cause —
|
|
96
121
|
look at the CSS-variable pipeline instead.
|
|
97
122
|
|
|
98
|
-
|
|
123
|
+
The one that matters on web is handed over in a line, and it works on any
|
|
124
|
+
bundler:
|
|
99
125
|
|
|
100
126
|
```ts
|
|
101
127
|
import * as ExpoVideo from 'expo-video';
|
|
102
|
-
import NetInfo from '@react-native-community/netinfo';
|
|
103
128
|
import { provideExpoVideo } from '@oxyhq/bloom/media-flight';
|
|
104
|
-
import { provideNetInfo } from '@oxyhq/bloom/connection-status';
|
|
105
129
|
|
|
106
130
|
provideExpoVideo(ExpoVideo); // otherwise video silently shows only its poster
|
|
107
|
-
provideNetInfo(NetInfo); // otherwise the outage toast never appears
|
|
108
131
|
```
|
|
109
132
|
|
|
133
|
+
`provideNetInfo` exists in `@oxyhq/bloom/connection-status` for the same
|
|
134
|
+
purpose, but a browser does not need it — see above.
|
|
135
|
+
|
|
110
136
|
## Recommended layout
|
|
111
137
|
|
|
112
138
|
If your app supports both light and dark themes:
|
package/docs/media-flight.mdx
CHANGED
|
@@ -590,10 +590,15 @@ installed**, and video degrades to its poster.
|
|
|
590
590
|
**Do not test for this with `typeof require`.** The cause depends on the
|
|
591
591
|
bundler and the symptom does not:
|
|
592
592
|
|
|
593
|
-
| bundler |
|
|
593
|
+
| bundler | what the guard sees | what happens |
|
|
594
594
|
| --- | --- | --- |
|
|
595
|
-
| Rollup / Vite | `
|
|
596
|
-
| esbuild |
|
|
595
|
+
| Rollup / Vite (classic) | no `require` | the guard degrades |
|
|
596
|
+
| esbuild | a shim that THROWS | the guard passes, the call fails inside the `try` |
|
|
597
|
+
| Vite 8 / Rolldown | `__require`, a Proxy-backed **function** | the guard passes, the call throws |
|
|
598
|
+
|
|
599
|
+
And `typeof require` in your console does NOT tell you which one you are in: in
|
|
600
|
+
a real Rolldown app it answers `"undefined"` while the compiled guard consults
|
|
601
|
+
an imported `__require` that is a function.
|
|
597
602
|
|
|
598
603
|
One line at startup fixes it, on any bundler:
|
|
599
604
|
|
|
@@ -82,6 +82,13 @@ let hasWarned = false;
|
|
|
82
82
|
* bundle: the consumer, who knows it has the peer and which entry of it its own
|
|
83
83
|
* bundler resolved, hands the module in.
|
|
84
84
|
*
|
|
85
|
+
* A BROWSER DOES NOT NEED IT. `connection-status/index.web.ts` resolves to
|
|
86
|
+
* `ConnectionStatusToasts.web.tsx`, which uses `navigator.onLine` and the
|
|
87
|
+
* `online`/`offline` events and never calls `loadNetInfo` — measured in a real
|
|
88
|
+
* Vite/Rolldown app, where netinfo was installed, unused, and absent from every
|
|
89
|
+
* chunk. This hatch is for a NON-Metro bundle that still takes the native path:
|
|
90
|
+
* an SSR pass, a test runner, a future non-Metro native bundler.
|
|
91
|
+
*
|
|
85
92
|
* The `require` below cannot be relied on off Metro, and the reason is worth
|
|
86
93
|
* knowing because the symptom is identical while the cause is not:
|
|
87
94
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["netInfoModule","providedModule","unavailableReason","hasWarned","provideNetInfo","module","undefined","loadNetInfo","require","loaded","resolved","addEventListener","default","error","Error","message","String","warnNetInfoUnavailable","process","env","NODE_ENV","console","warn"],"sourceRoot":"../../../src","sources":["connection-status/netinfo.ts"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAGA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA,IAAIA,aAA6C;AACjD;AACA,IAAIC,cAAkC,GAAG,IAAI;AAC7C;AACA,IAAIC,iBAAiB,GAAG,EAAE;AAC1B,IAAIC,SAAS,GAAG,KAAK;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAACC,MAA0B,EAAQ;EAC/DJ,cAAc,GAAGI,MAAM;EACvBL,aAAa,GAAGM,SAAS;EACzBH,SAAS,GAAG,KAAK;AACnB;;AAEA;AACO,SAASI,WAAWA,CAAA,EAAuB;EAChD,IAAIN,cAAc,KAAK,IAAI,EAAE,OAAOA,cAAc;EAClD,IAAID,aAAa,KAAKM,SAAS,EAAE,OAAON,aAAa;EACrDA,aAAa,GAAG,IAAI;;EAEpB;EACA;EACA;EACA;EACA,IAAI,OAAOQ,OAAO,KAAK,WAAW,EAAE;IAClCN,iBAAiB,GAAG,uCAAuC;IAC3D,OAAOF,aAAa;EACtB;EAEA,IAAI;IACF;IACA;IACA;IACA,MAAMS,MAAM,GAAGD,OAAO,CAAC,iCAAiC,CAG3C;IACb,MAAME,QAAQ,GAAG,OAAOD,MAAM,EAAEE,gBAAgB,KAAK,UAAU,GAAGF,MAAM,GAAGA,MAAM,EAAEG,OAAO;IAE1F,IAAI,OAAOF,QAAQ,EAAEC,gBAAgB,KAAK,UAAU,EAAE;MACpDX,aAAa,GAAGU,QAAuB;IACzC,CAAC,MAAM;MACLR,iBAAiB,GAAG,0DAA0D;IAChF;EACF,CAAC,CAAC,OAAOW,KAAK,EAAE;IACdX,iBAAiB,GAAGW,KAAK,YAAYC,KAAK,GAAGD,KAAK,CAACE,OAAO,GAAGC,MAAM,CAACH,KAAK,CAAC;EAC5E;EAEA,OAAOb,aAAa;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASiB,sBAAsBA,CAAA,EAAS;EAC7C,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,IAAIjB,SAAS,EAAE;EACxDA,SAAS,GAAG,IAAI;EAChB;EACA;EACA;EACAkB,OAAO,CAACC,IAAI,CACV,6DAA6D,GAC3D,+EAA+E,GAC/E,8EAA8E,GAC9E,6EAA6E,GAC7E,oDAAoDpB,iBAAiB,EACzE,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["netInfoModule","providedModule","unavailableReason","hasWarned","provideNetInfo","module","undefined","loadNetInfo","require","loaded","resolved","addEventListener","default","error","Error","message","String","warnNetInfoUnavailable","process","env","NODE_ENV","console","warn"],"sourceRoot":"../../../src","sources":["connection-status/netinfo.ts"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAGA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA,IAAIA,aAA6C;AACjD;AACA,IAAIC,cAAkC,GAAG,IAAI;AAC7C;AACA,IAAIC,iBAAiB,GAAG,EAAE;AAC1B,IAAIC,SAAS,GAAG,KAAK;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAACC,MAA0B,EAAQ;EAC/DJ,cAAc,GAAGI,MAAM;EACvBL,aAAa,GAAGM,SAAS;EACzBH,SAAS,GAAG,KAAK;AACnB;;AAEA;AACO,SAASI,WAAWA,CAAA,EAAuB;EAChD,IAAIN,cAAc,KAAK,IAAI,EAAE,OAAOA,cAAc;EAClD,IAAID,aAAa,KAAKM,SAAS,EAAE,OAAON,aAAa;EACrDA,aAAa,GAAG,IAAI;;EAEpB;EACA;EACA;EACA;EACA,IAAI,OAAOQ,OAAO,KAAK,WAAW,EAAE;IAClCN,iBAAiB,GAAG,uCAAuC;IAC3D,OAAOF,aAAa;EACtB;EAEA,IAAI;IACF;IACA;IACA;IACA,MAAMS,MAAM,GAAGD,OAAO,CAAC,iCAAiC,CAG3C;IACb,MAAME,QAAQ,GAAG,OAAOD,MAAM,EAAEE,gBAAgB,KAAK,UAAU,GAAGF,MAAM,GAAGA,MAAM,EAAEG,OAAO;IAE1F,IAAI,OAAOF,QAAQ,EAAEC,gBAAgB,KAAK,UAAU,EAAE;MACpDX,aAAa,GAAGU,QAAuB;IACzC,CAAC,MAAM;MACLR,iBAAiB,GAAG,0DAA0D;IAChF;EACF,CAAC,CAAC,OAAOW,KAAK,EAAE;IACdX,iBAAiB,GAAGW,KAAK,YAAYC,KAAK,GAAGD,KAAK,CAACE,OAAO,GAAGC,MAAM,CAACH,KAAK,CAAC;EAC5E;EAEA,OAAOb,aAAa;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASiB,sBAAsBA,CAAA,EAAS;EAC7C,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,IAAIjB,SAAS,EAAE;EACxDA,SAAS,GAAG,IAAI;EAChB;EACA;EACA;EACAkB,OAAO,CAACC,IAAI,CACV,6DAA6D,GAC3D,+EAA+E,GAC/E,8EAA8E,GAC9E,6EAA6E,GAC7E,oDAAoDpB,iBAAiB,EACzE,CAAC;AACH","ignoreList":[]}
|
|
@@ -76,6 +76,13 @@ let hasWarned = false;
|
|
|
76
76
|
* bundle: the consumer, who knows it has the peer and which entry of it its own
|
|
77
77
|
* bundler resolved, hands the module in.
|
|
78
78
|
*
|
|
79
|
+
* A BROWSER DOES NOT NEED IT. `connection-status/index.web.ts` resolves to
|
|
80
|
+
* `ConnectionStatusToasts.web.tsx`, which uses `navigator.onLine` and the
|
|
81
|
+
* `online`/`offline` events and never calls `loadNetInfo` — measured in a real
|
|
82
|
+
* Vite/Rolldown app, where netinfo was installed, unused, and absent from every
|
|
83
|
+
* chunk. This hatch is for a NON-Metro bundle that still takes the native path:
|
|
84
|
+
* an SSR pass, a test runner, a future non-Metro native bundler.
|
|
85
|
+
*
|
|
79
86
|
* The `require` below cannot be relied on off Metro, and the reason is worth
|
|
80
87
|
* knowing because the symptom is identical while the cause is not:
|
|
81
88
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["netInfoModule","providedModule","unavailableReason","hasWarned","provideNetInfo","module","undefined","loadNetInfo","require","loaded","resolved","addEventListener","default","error","Error","message","String","warnNetInfoUnavailable","process","env","NODE_ENV","console","warn"],"sourceRoot":"../../../src","sources":["connection-status/netinfo.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAGA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA,IAAIA,aAA6C;AACjD;AACA,IAAIC,cAAkC,GAAG,IAAI;AAC7C;AACA,IAAIC,iBAAiB,GAAG,EAAE;AAC1B,IAAIC,SAAS,GAAG,KAAK;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAACC,MAA0B,EAAQ;EAC/DJ,cAAc,GAAGI,MAAM;EACvBL,aAAa,GAAGM,SAAS;EACzBH,SAAS,GAAG,KAAK;AACnB;;AAEA;AACA,OAAO,SAASI,WAAWA,CAAA,EAAuB;EAChD,IAAIN,cAAc,KAAK,IAAI,EAAE,OAAOA,cAAc;EAClD,IAAID,aAAa,KAAKM,SAAS,EAAE,OAAON,aAAa;EACrDA,aAAa,GAAG,IAAI;;EAEpB;EACA;EACA;EACA;EACA,IAAI,OAAOQ,OAAO,KAAK,WAAW,EAAE;IAClCN,iBAAiB,GAAG,uCAAuC;IAC3D,OAAOF,aAAa;EACtB;EAEA,IAAI;IACF;IACA;IACA;IACA,MAAMS,MAAM,GAAGD,OAAO,CAAC,iCAAiC,CAG3C;IACb,MAAME,QAAQ,GAAG,OAAOD,MAAM,EAAEE,gBAAgB,KAAK,UAAU,GAAGF,MAAM,GAAGA,MAAM,EAAEG,OAAO;IAE1F,IAAI,OAAOF,QAAQ,EAAEC,gBAAgB,KAAK,UAAU,EAAE;MACpDX,aAAa,GAAGU,QAAuB;IACzC,CAAC,MAAM;MACLR,iBAAiB,GAAG,0DAA0D;IAChF;EACF,CAAC,CAAC,OAAOW,KAAK,EAAE;IACdX,iBAAiB,GAAGW,KAAK,YAAYC,KAAK,GAAGD,KAAK,CAACE,OAAO,GAAGC,MAAM,CAACH,KAAK,CAAC;EAC5E;EAEA,OAAOb,aAAa;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASiB,sBAAsBA,CAAA,EAAS;EAC7C,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,IAAIjB,SAAS,EAAE;EACxDA,SAAS,GAAG,IAAI;EAChB;EACA;EACA;EACAkB,OAAO,CAACC,IAAI,CACV,6DAA6D,GAC3D,+EAA+E,GAC/E,8EAA8E,GAC9E,6EAA6E,GAC7E,oDAAoDpB,iBAAiB,EACzE,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["netInfoModule","providedModule","unavailableReason","hasWarned","provideNetInfo","module","undefined","loadNetInfo","require","loaded","resolved","addEventListener","default","error","Error","message","String","warnNetInfoUnavailable","process","env","NODE_ENV","console","warn"],"sourceRoot":"../../../src","sources":["connection-status/netinfo.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAGA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA,IAAIA,aAA6C;AACjD;AACA,IAAIC,cAAkC,GAAG,IAAI;AAC7C;AACA,IAAIC,iBAAiB,GAAG,EAAE;AAC1B,IAAIC,SAAS,GAAG,KAAK;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAACC,MAA0B,EAAQ;EAC/DJ,cAAc,GAAGI,MAAM;EACvBL,aAAa,GAAGM,SAAS;EACzBH,SAAS,GAAG,KAAK;AACnB;;AAEA;AACA,OAAO,SAASI,WAAWA,CAAA,EAAuB;EAChD,IAAIN,cAAc,KAAK,IAAI,EAAE,OAAOA,cAAc;EAClD,IAAID,aAAa,KAAKM,SAAS,EAAE,OAAON,aAAa;EACrDA,aAAa,GAAG,IAAI;;EAEpB;EACA;EACA;EACA;EACA,IAAI,OAAOQ,OAAO,KAAK,WAAW,EAAE;IAClCN,iBAAiB,GAAG,uCAAuC;IAC3D,OAAOF,aAAa;EACtB;EAEA,IAAI;IACF;IACA;IACA;IACA,MAAMS,MAAM,GAAGD,OAAO,CAAC,iCAAiC,CAG3C;IACb,MAAME,QAAQ,GAAG,OAAOD,MAAM,EAAEE,gBAAgB,KAAK,UAAU,GAAGF,MAAM,GAAGA,MAAM,EAAEG,OAAO;IAE1F,IAAI,OAAOF,QAAQ,EAAEC,gBAAgB,KAAK,UAAU,EAAE;MACpDX,aAAa,GAAGU,QAAuB;IACzC,CAAC,MAAM;MACLR,iBAAiB,GAAG,0DAA0D;IAChF;EACF,CAAC,CAAC,OAAOW,KAAK,EAAE;IACdX,iBAAiB,GAAGW,KAAK,YAAYC,KAAK,GAAGD,KAAK,CAACE,OAAO,GAAGC,MAAM,CAACH,KAAK,CAAC;EAC5E;EAEA,OAAOb,aAAa;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASiB,sBAAsBA,CAAA,EAAS;EAC7C,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,IAAIjB,SAAS,EAAE;EACxDA,SAAS,GAAG,IAAI;EAChB;EACA;EACA;EACAkB,OAAO,CAACC,IAAI,CACV,6DAA6D,GAC3D,+EAA+E,GAC/E,8EAA8E,GAC9E,6EAA6E,GAC7E,oDAAoDpB,iBAAiB,EACzE,CAAC;AACH","ignoreList":[]}
|
|
@@ -64,6 +64,13 @@ export interface NetInfoLike {
|
|
|
64
64
|
* bundle: the consumer, who knows it has the peer and which entry of it its own
|
|
65
65
|
* bundler resolved, hands the module in.
|
|
66
66
|
*
|
|
67
|
+
* A BROWSER DOES NOT NEED IT. `connection-status/index.web.ts` resolves to
|
|
68
|
+
* `ConnectionStatusToasts.web.tsx`, which uses `navigator.onLine` and the
|
|
69
|
+
* `online`/`offline` events and never calls `loadNetInfo` — measured in a real
|
|
70
|
+
* Vite/Rolldown app, where netinfo was installed, unused, and absent from every
|
|
71
|
+
* chunk. This hatch is for a NON-Metro bundle that still takes the native path:
|
|
72
|
+
* an SSR pass, a test runner, a future non-Metro native bundler.
|
|
73
|
+
*
|
|
67
74
|
* The `require` below cannot be relied on off Metro, and the reason is worth
|
|
68
75
|
* knowing because the symptom is identical while the cause is not:
|
|
69
76
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"netinfo.d.ts","sourceRoot":"","sources":["../../../../src/connection-status/netinfo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AASH,yDAAyD;AACzD,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5B,mBAAmB,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;CACjD;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;CAC/E;AAUD
|
|
1
|
+
{"version":3,"file":"netinfo.d.ts","sourceRoot":"","sources":["../../../../src/connection-status/netinfo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AASH,yDAAyD;AACzD,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5B,mBAAmB,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;CACjD;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;CAC/E;AAUD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAI/D;AAED,6EAA6E;AAC7E,wBAAgB,WAAW,IAAI,WAAW,GAAG,IAAI,CAkChD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAa7C"}
|
|
@@ -64,6 +64,13 @@ export interface NetInfoLike {
|
|
|
64
64
|
* bundle: the consumer, who knows it has the peer and which entry of it its own
|
|
65
65
|
* bundler resolved, hands the module in.
|
|
66
66
|
*
|
|
67
|
+
* A BROWSER DOES NOT NEED IT. `connection-status/index.web.ts` resolves to
|
|
68
|
+
* `ConnectionStatusToasts.web.tsx`, which uses `navigator.onLine` and the
|
|
69
|
+
* `online`/`offline` events and never calls `loadNetInfo` — measured in a real
|
|
70
|
+
* Vite/Rolldown app, where netinfo was installed, unused, and absent from every
|
|
71
|
+
* chunk. This hatch is for a NON-Metro bundle that still takes the native path:
|
|
72
|
+
* an SSR pass, a test runner, a future non-Metro native bundler.
|
|
73
|
+
*
|
|
67
74
|
* The `require` below cannot be relied on off Metro, and the reason is worth
|
|
68
75
|
* knowing because the symptom is identical while the cause is not:
|
|
69
76
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"netinfo.d.ts","sourceRoot":"","sources":["../../../../src/connection-status/netinfo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AASH,yDAAyD;AACzD,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5B,mBAAmB,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;CACjD;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;CAC/E;AAUD
|
|
1
|
+
{"version":3,"file":"netinfo.d.ts","sourceRoot":"","sources":["../../../../src/connection-status/netinfo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AASH,yDAAyD;AACzD,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5B,mBAAmB,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;CACjD;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;CAC/E;AAUD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAI/D;AAED,6EAA6E;AAC7E,wBAAgB,WAAW,IAAI,WAAW,GAAG,IAAI,CAkChD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAa7C"}
|
package/package.json
CHANGED
|
@@ -82,6 +82,13 @@ let hasWarned = false;
|
|
|
82
82
|
* bundle: the consumer, who knows it has the peer and which entry of it its own
|
|
83
83
|
* bundler resolved, hands the module in.
|
|
84
84
|
*
|
|
85
|
+
* A BROWSER DOES NOT NEED IT. `connection-status/index.web.ts` resolves to
|
|
86
|
+
* `ConnectionStatusToasts.web.tsx`, which uses `navigator.onLine` and the
|
|
87
|
+
* `online`/`offline` events and never calls `loadNetInfo` — measured in a real
|
|
88
|
+
* Vite/Rolldown app, where netinfo was installed, unused, and absent from every
|
|
89
|
+
* chunk. This hatch is for a NON-Metro bundle that still takes the native path:
|
|
90
|
+
* an SSR pass, a test runner, a future non-Metro native bundler.
|
|
91
|
+
*
|
|
85
92
|
* The `require` below cannot be relied on off Metro, and the reason is worth
|
|
86
93
|
* knowing because the symptom is identical while the cause is not:
|
|
87
94
|
*
|