-
-
Notifications
You must be signed in to change notification settings - Fork 38
Update lib to react-native-windows 0.82 new arch #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <configuration> | ||
| <packageSources> | ||
| <clear /> | ||
| <add key="react-native" value="https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/nuget/v3/index.json" /> | ||
| <add key="Nuget.org" value="https://api.nuget.org/v3/index.json" /> | ||
| </packageSources> | ||
| <disabledPackageSources> | ||
| <clear /> | ||
| </disabledPackageSources> | ||
| </configuration> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <configuration> | ||
| <!-- This placeholder file is reserved for future use, but also to prevent | ||
| using the config from the cpp-app template, allowing the lib to rely on | ||
| config file added to its root. --> | ||
| </configuration> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,6 +60,7 @@ const UPLOAD_FILES_CONTROL = Platform.select({ | |
|
|
||
| export const uploadTests: TestMethods = { | ||
| 'uploadFiles() should upload files': async () => { | ||
| if (Platform.OS === 'windows') return Result.notAvailable('windows'); | ||
| try { | ||
| // prepare | ||
| const server = await waitServer(); | ||
|
|
@@ -121,6 +122,7 @@ export const uploadTests: TestMethods = { | |
| } | ||
| }, | ||
| 'uploadFiles() should handle HTTP errors': async () => { | ||
| if (Platform.OS === 'windows') return Result.notAvailable('windows'); | ||
| try { | ||
| // prepare | ||
| const server = await waitServer(); | ||
|
|
@@ -154,6 +156,7 @@ export const uploadTests: TestMethods = { | |
| } | ||
| }, | ||
| 'stopUpload() should stop an upload process [iOS]': async () => { | ||
| if (Platform.OS === 'windows') return Result.notAvailable('windows'); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess, this is effectively covered by the next line? Also the argument(s) of
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, good point this is silly. No need. |
||
| if (notPlatform('ios')) return Result.notAvailable('ios'); | ||
| const uploadFileName = 'upload-file-3.txt'; //! no support for ÄÖÜ | ||
| try { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ import { | |
| unlink, | ||
| } from '@dr.pogodin/react-native-fs'; | ||
|
|
||
| import Server from '@dr.pogodin/react-native-static-server'; | ||
| import type StaticServer from '@dr.pogodin/react-native-static-server'; | ||
| import { Platform } from 'react-native'; | ||
|
|
||
| // NOTE: The path resolved for server by resolveAssetsPath() | ||
|
|
@@ -14,16 +14,23 @@ export const FILE_DIR = Platform.select({ | |
| default: `${TemporaryDirectoryPath}test-server`, | ||
| }); | ||
|
|
||
| let serverPromise: Promise<Server> | undefined; | ||
| let serverPromise: Promise<StaticServer> | undefined; | ||
|
|
||
| export async function start() { | ||
| if (Platform.OS === 'windows') { | ||
| return undefined; | ||
| } | ||
|
|
||
| if (!serverPromise) { | ||
| serverPromise = new Promise(async (resolve, reject) => { | ||
| try { | ||
| try { | ||
| await unlink(FILE_DIR); | ||
| } catch {} | ||
| await mkdir(`${FILE_DIR}/dav`); | ||
| const Server = require( | ||
| '@dr.pogodin/react-native-static-server', | ||
| ).default as typeof import('@dr.pogodin/react-native-static-server').default; | ||
|
Comment on lines
+31
to
+33
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm... wouldn't it work with just? const Server = await import('@dr.pogodin/react-native-static-server');
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is enough yes, however adding |
||
| const server = new Server({ | ||
| fileDir: FILE_DIR, | ||
| port: 3000, | ||
|
|
@@ -59,6 +66,10 @@ export async function start() { | |
| } | ||
|
|
||
| export async function stop() { | ||
| if (Platform.OS === 'windows') { | ||
| return; | ||
| } | ||
|
|
||
| if (serverPromise) { | ||
| const server = await serverPromise; | ||
| await server.stop(); | ||
|
|
@@ -67,5 +78,11 @@ export async function stop() { | |
| } | ||
|
|
||
| export async function waitServer() { | ||
| if (Platform.OS === 'windows') { | ||
| throw new Error( | ||
| '@dr.pogodin/react-native-static-server is disabled on Windows until it supports RNW new architecture.', | ||
| ); | ||
| } | ||
|
|
||
| return serverPromise || start(); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,92 +1,46 @@ | ||
| *AppPackages* | ||
| *BundleArtifacts* | ||
|
|
||
| #OS junk files | ||
| [Tt]humbs.db | ||
| *.DS_Store | ||
|
|
||
| #Visual Studio files | ||
| *.[Oo]bj | ||
| *.user | ||
| *.aps | ||
| *.pch | ||
| *.vspscc | ||
| *.vssscc | ||
| *_i.c | ||
| *_p.c | ||
| *.ncb | ||
| *.suo | ||
| *.tlb | ||
| *.tlh | ||
| *.bak | ||
| *.[Cc]ache | ||
| *.ilk | ||
| *.log | ||
| *.lib | ||
| *.sbr | ||
| *.sdf | ||
| *.opensdf | ||
| *.opendb | ||
| *.unsuccessfulbuild | ||
| ipch/ | ||
| [Oo]bj/ | ||
| [Bb]in | ||
| [Dd]ebug*/ | ||
| [Rr]elease*/ | ||
| Ankh.NoLoad | ||
|
|
||
| # Visual C++ cache files | ||
| ipch/ | ||
| *.aps | ||
| *.ncb | ||
| *.opendb | ||
| *.opensdf | ||
| *.sdf | ||
| *.cachefile | ||
| *.VC.db | ||
| *.VC.VC.opendb | ||
|
|
||
| #MonoDevelop | ||
| *.pidb | ||
| *.userprefs | ||
|
|
||
| #Tooling | ||
| _ReSharper*/ | ||
| *.resharper | ||
| [Tt]est[Rr]esult* | ||
| *.sass-cache | ||
|
|
||
| #Project files | ||
| [Bb]uild/ | ||
|
|
||
| #Subversion files | ||
| .svn | ||
|
|
||
| # Office Temp Files | ||
| ~$* | ||
|
|
||
| # vim Temp Files | ||
| *~ | ||
|
|
||
| #NuGet | ||
| packages/ | ||
| *.nupkg | ||
|
|
||
| #ncrunch | ||
| *ncrunch* | ||
| *crunch*.local.xml | ||
|
|
||
| # visual studio database projects | ||
| *.dbmdl | ||
|
|
||
| #Test files | ||
| *.testsettings | ||
|
|
||
| #Other files | ||
| *.DotSettings | ||
| .vs/ | ||
| *project.lock.json | ||
|
|
||
| #Files generated by the VS build | ||
| **/Generated Files/** | ||
|
|
||
| *AppPackages* | ||
| *BundleArtifacts* | ||
|
|
||
| #OS junk files | ||
| [Tt]humbs.db | ||
| *.DS_Store | ||
|
|
||
| #Visual Studio files | ||
| *.[Oo]bj | ||
| *.user | ||
| *.aps | ||
| *.pch | ||
| *.vspscc | ||
| *.vssscc | ||
| *_i.c | ||
| *_p.c | ||
| *.ncb | ||
| *.suo | ||
| *.tlb | ||
| *.tlh | ||
| *.bak | ||
| *.[Cc]ache | ||
| *.ilk | ||
| *.log | ||
| *.lib | ||
| *.sbr | ||
| *.sdf | ||
| *.opensdf | ||
| *.opendb | ||
| *.unsuccessfulbuild | ||
| ipch/ | ||
| [Oo]bj/ | ||
| [Bb]in | ||
| [Dd]ebug*/ | ||
| [Rr]elease*/ | ||
| Ankh.NoLoad | ||
| .vs/ | ||
| # Visual C++ cache files | ||
|
|
||
| #Files generated by the VS build | ||
| **/Generated Files/** | ||
|
|
||
| #Files generated by MS build | ||
| *.binlog | ||
| *.err | ||
| *.wrn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need it? I don't think I had any problems without it, and RN docs for v0.84 tell Hermes V1 is the default with no need for any config changes?
https://reactnative.dev/blog/2026/02/11/react-native-0.84#hermes-v1-as-default
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is mysterious yes as Hermes V1 is the default now.
However, I ran into gradle dependencies issues without setting this flag explicitly.
I guess if it works for you in the example app without then should be fine. Maybe some local machine shenanigans.
I can dig deeper on this one if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like build problems on Android without this flag were caused by having
react-native-windows@0.82installed alongsidereact-native@0.84. Gonna removereact-native-windowsfor now from allpackage.jsonfiles, so that it does not mess anything on other platforms, and to run the example on Windows it will be necessary to install it explicitly.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Yeah that's reasonable.
Hopefully react-native-windows gets up-to-date soon.