Skip to content

Commit 0ac5979

Browse files
authored
Merge branch 'main' into keyDownEvents
2 parents 9f5c5b9 + 09cf897 commit 0ac5979

File tree

22 files changed

+246
-245
lines changed

22 files changed

+246
-245
lines changed

.ado/jobs/build-test-rntester.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@ jobs:
9898
steps:
9999
- template: /.ado/templates/apple-tools-setup.yml@self
100100

101+
- ${{ if in(slice.sdk, 'xros', 'xrsimulator') }}:
102+
- task: CmdLine@2
103+
displayName: Download visionOS SDDK
104+
inputs:
105+
script: |
106+
set -eox pipefail
107+
# https://github.com/actions/runner-images/issues/10559
108+
sudo xcodebuild -runFirstLaunch
109+
sudo xcrun simctl list
110+
sudo xcodebuild -downloadPlatform visionOS
111+
sudo xcodebuild -runFirstLaunch
112+
101113
- task: CmdLine@2
102114
displayName: yarn install
103115
inputs:

.ado/jobs/test-react-native-macos-init.yml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,22 @@ jobs:
1313

1414
- template: /.ado/templates/apple-tools-setup.yml@self
1515

16+
- task: CmdLine@2
17+
displayName: yarn install react-native-macos-init
18+
inputs:
19+
script: |
20+
set -eox pipefail
21+
cd packages/react-native-macos-init
22+
yarn install
23+
24+
- task: CmdLine@2
25+
displayName: Build react-native-macos-init
26+
inputs:
27+
script: |
28+
set -eox pipefail
29+
cd packages/react-native-macos-init
30+
yarn build
31+
1632
- template: /.ado/templates/verdaccio-init.yml@self
1733

1834
- template: /.ado/templates/verdaccio-publish.yml@self
@@ -21,42 +37,56 @@ jobs:
2137
- task: CmdLine@2
2238
displayName: yarn install (local react-native-macos)
2339
inputs:
24-
script: yarn install --immutable
40+
script: |
41+
set -eox pipefail
42+
yarn install --immutable
2543
2644
- task: CmdLine@2
2745
displayName: yarn install (local react-native-macos-init)
2846
inputs:
2947
script: |
48+
set -eox pipefail
3049
cd packages/react-native-macos-init
3150
yarn install --immutable
3251
3352
- task: CmdLine@2
3453
displayName: yarn build (local react-native-macos-init)
3554
inputs:
3655
script: |
56+
set -eox pipefail
3757
cd packages/react-native-macos-init
3858
yarn build
3959
4060
- task: CmdLine@2
4161
displayName: Init new project
4262
inputs:
43-
script: npx --yes [email protected] init testcli --template [email protected] --skip-install
63+
script: |
64+
set -eox pipefail
65+
npx --yes @react-native-community/cli init testcli --version 0.75 --skip-install
4466
workingDirectory: $(Agent.BuildDirectory)
4567

4668
- task: CmdLine@2
47-
displayName: yarn install (local react-native-macos-init)
69+
displayName: yarn install (testcli)
4870
inputs:
49-
script: yarn install --immutable
71+
script: |
72+
set -eox pipefail
73+
yarn install --mode=update-lockfile
74+
# `update-lockfile` skips the linking step, so we need to run `yarn install` again
75+
yarn install
5076
workingDirectory: $(Agent.BuildDirectory)/testcli
5177

5278
- task: CmdLine@2
5379
displayName: Apply macos template
5480
inputs:
55-
script: npx react-native-macos-init --version latest --overwrite --prerelease
81+
script: |
82+
set -eox pipefail
83+
npx react-native-macos-init --version latest --overwrite --prerelease
5684
workingDirectory: $(Agent.BuildDirectory)/testcli
5785

5886
- task: CmdLine@2
5987
displayName: Run macos [test]
6088
inputs:
61-
script: npx react-native run-macos
89+
script: |
90+
set -eox pipefail
91+
npx react-native run-macos
6292
workingDirectory: $(Agent.BuildDirectory)/testcli

packages/helloworld/Gemfile.lock

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,21 @@ GEM
7676
netrc (0.11.0)
7777
nkf (0.2.0)
7878
public_suffix (4.0.7)
79-
rexml (3.2.6)
79+
rexml (3.3.6)
80+
strscan
8081
ruby-macho (2.5.1)
82+
strscan (3.1.0)
8183
typhoeus (1.4.1)
8284
ethon (>= 0.9.0)
8385
tzinfo (2.0.6)
8486
concurrent-ruby (~> 1.0)
85-
xcodeproj (1.24.0)
87+
xcodeproj (1.25.0)
8688
CFPropertyList (>= 2.3.3, < 4.0)
8789
atomos (~> 0.1.3)
8890
claide (>= 1.0.2, < 2.0)
8991
colored2 (~> 3.1)
9092
nanaimo (~> 0.3.0)
91-
rexml (~> 3.2.4)
93+
rexml (>= 3.3.2, < 4.0)
9294
zeitwerk (2.6.13)
9395

9496
PLATFORMS

packages/react-native-macos-init/CHANGELOG.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
{
22
"name": "react-native-macos-init",
33
"entries": [
4+
{
5+
"date": "Tue, 15 Oct 2024 20:02:42 GMT",
6+
"version": "2.1.3",
7+
"tag": "react-native-macos-init_v2.1.3",
8+
"comments": {
9+
"patch": [
10+
{
11+
"author": "[email protected]",
12+
"package": "react-native-macos-init",
13+
"commit": "b86ac5239832d7d72e22cb84b1878ce2f73138fe",
14+
"comment": "fix: Properly import `npm-registry-fetch` in `react-native-macos-init`"
15+
}
16+
]
17+
}
18+
},
419
{
520
"date": "Mon, 18 May 2020 23:31:12 GMT",
621
"tag": "react-native-macos-init_v2.1.0",

packages/react-native-macos-init/CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
# Change Log - react-native-macos-init
22

3-
This log was last generated on Mon, 18 May 2020 23:31:12 GMT and should not be manually modified.
3+
This log was last generated on Tue, 15 Oct 2024 20:02:42 GMT and should not be manually modified.
44

55
<!-- Start content -->
66

7+
## 2.1.3
8+
9+
Tue, 15 Oct 2024 20:02:42 GMT
10+
11+
### Patches
12+
13+
- fix: Properly import `npm-registry-fetch` in `react-native-macos-init` ([email protected])
14+
715
## 2.1.0
816

917
Mon, 18 May 2020 23:31:12 GMT

packages/react-native-macos-init/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-macos-init",
3-
"version": "2.1.0",
3+
"version": "2.1.3",
44
"description": "CLI to add react-native-macos to an existing react-native project",
55
"main": "index.js",
66
"repository": "https://github.com/microsoft/react-native-macos",

packages/react-native-macos-init/src/cli.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ import * as validUrl from 'valid-url';
1313
import * as prompts from 'prompts';
1414
import * as findUp from 'find-up';
1515
import * as chalk from 'chalk';
16-
// @ts-ignore
17-
import npmFetch from 'npm-registry';
16+
import * as npmFetch from 'npm-registry-fetch';
1817

1918
const npmConfReg = execSync('npm config get registry').toString().trim();
2019
const NPM_REGISTRY_URL = validUrl.isUri(npmConfReg)

packages/react-native/Libraries/Image/RCTImageBlurUtils.mm

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,22 @@
2525

2626
// convert to ARGB if it isn't
2727
if (CGImageGetBitsPerPixel(imageRef) != 32 || !((CGImageGetBitmapInfo(imageRef) & kCGBitmapAlphaInfoMask))) {
28-
#if !TARGET_OS_OSX // [macOS]
29-
UIGraphicsImageRendererFormat *const rendererFormat = [UIGraphicsImageRendererFormat defaultFormat];
30-
rendererFormat.scale = inputImage.scale;
31-
UIGraphicsImageRenderer *const renderer = [[UIGraphicsImageRenderer alloc] initWithSize:inputImage.size
32-
format:rendererFormat];
28+
RCTUIGraphicsImageRendererFormat *const rendererFormat = [RCTUIGraphicsImageRendererFormat defaultFormat]; // [macOS]
29+
rendererFormat.scale = UIImageGetScale(inputImage); // [macOS]
30+
RCTUIGraphicsImageRenderer *const renderer = [[RCTUIGraphicsImageRenderer alloc] initWithSize:inputImage.size // [macOS]
31+
format:rendererFormat];
3332

33+
#if !TARGET_OS_OSX // [macOS]
3434
imageRef = [renderer imageWithActions:^(UIGraphicsImageRendererContext *_Nonnull context) {
3535
[inputImage drawAtPoint:CGPointZero];
3636
}].CGImage;
3737
#else // [macOS
38-
UIGraphicsBeginImageContextWithOptions(inputImage.size, NO, imageScale);
39-
[inputImage drawAtPoint:CGPointZero fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0];
40-
imageRef = (CGImageRef)CFAutorelease(CGBitmapContextCreateImage(UIGraphicsGetCurrentContext()));
41-
UIGraphicsEndImageContext();
38+
NSImage *image = [renderer imageWithActions:^(RCTUIGraphicsImageRendererContext *_Nonnull context) {
39+
[inputImage drawAtPoint:CGPointZero fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0];
40+
}];
41+
imageRef = UIImageGetCGImageRef(image);
4242
#endif // macOS]
4343
}
44-
4544
vImage_Buffer buffer1, buffer2;
4645
buffer1.width = buffer2.width = CGImageGetWidth(imageRef);
4746
buffer1.height = buffer2.height = CGImageGetHeight(imageRef);

packages/react-native/Libraries/Image/RCTImageUtils.mm

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -382,25 +382,19 @@ BOOL RCTUpscalingRequired(
382382
}
383383

384384
BOOL opaque = !RCTUIImageHasAlpha(image); // [macOS]
385-
#if !TARGET_OS_OSX // [macOS]
386-
UIGraphicsImageRendererFormat *const rendererFormat = [UIGraphicsImageRendererFormat defaultFormat];
385+
RCTUIGraphicsImageRendererFormat *const rendererFormat = [RCTUIGraphicsImageRendererFormat defaultFormat]; // [macOS]
387386
rendererFormat.opaque = opaque;
388387
rendererFormat.scale = destScale;
389-
UIGraphicsImageRenderer *const renderer = [[UIGraphicsImageRenderer alloc] initWithSize:destSize
388+
RCTUIGraphicsImageRenderer *const renderer = [[RCTUIGraphicsImageRenderer alloc] initWithSize:destSize // [macOS]
390389
format:rendererFormat];
391-
return [renderer imageWithActions:^(UIGraphicsImageRendererContext *_Nonnull context) {
390+
return [renderer imageWithActions:^(RCTUIGraphicsImageRendererContext *_Nonnull context) { // [macOS]
392391
CGContextConcatCTM(context.CGContext, transform);
392+
#if !TARGET_OS_OSX // [macOS]
393393
[image drawAtPoint:CGPointZero];
394-
}];
395394
#else // [macOS
396-
UIGraphicsBeginImageContextWithOptions(destSize, opaque, destScale);
397-
CGContextRef currentContext = UIGraphicsGetCurrentContext();
398-
CGContextConcatCTM(currentContext, transform);
399-
[image drawAtPoint:CGPointZero fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0];
400-
UIImage *result = UIGraphicsGetImageFromCurrentImageContext();
401-
UIGraphicsEndImageContext();
402-
return result;
395+
[image drawAtPoint:CGPointZero fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0];
403396
#endif // macOS]
397+
}];
404398
}
405399

406400
BOOL RCTImageHasAlpha(CGImageRef image)

packages/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ - (void)deleteBackward {
587587
}
588588
#else // [macOS
589589
- (BOOL)performKeyEquivalent:(NSEvent *)event {
590-
if (!self.hasMarkedText && ![self.textInputDelegate textInputShouldHandleKeyEvent:event]) {
590+
if (self.window.firstResponder == self && !self.hasMarkedText && ![self.textInputDelegate textInputShouldHandleKeyEvent:event]) {
591591
return YES;
592592
}
593593

0 commit comments

Comments
 (0)