Commit 762ce28
committed
ZLPConstants (ios): Expose
This points to a location that's part of the built app (i.e.,
something from `[NSBundle mainBundle]`.
We tried using a convenient-looking React Native method,
`RCTBundleURLProvider.resourceURLForResourceRoot` [1]. This would be
useful if we wanted the files in `ios/webview` as they're served by
the packager if the packager is running (i.e., at a URL like
http://192.168.0.108:8081/ios/webview/index.html).
We don't, particularly. In theory, seeing updates to, e.g.,
`ios/webview/base.css` without having to rebuild might be nice...but
things are set up so that we never change that file manually.
Instead, we expect it to be generated for us at build time, as a
build phase (that runs `tools/build-webview`). Best not to give any
incentive to edit an auto-generated file.
Also, that React Native method just won't work nicely for us, it
seems. I haven't found a way to use it to express that we want
"/ios/webview/index.html" when we're talking to the packager, and
just "/webview/index.html" when we're talking to `[NSBundle
mainBundle]`.
And: Mock `ReactNative.NativeModules.ZLPConstants`, as we probably
should have done for `appIdentifierPrefix`. But we're about to
remove that, in the next commit.
See also discussion [2].
[1]: Added in facebook/react-native@150c522be.
[2]: https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/Resource.20URLs/near/924227resourceURL, from the bundle.1 parent 9a778e5 commit 762ce28
2 files changed
+14
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
| |||
0 commit comments