react-native-windows 0.66.4 → 0.66.5

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/CHANGELOG.json CHANGED
@@ -2,7 +2,22 @@
2
2
  "name": "react-native-windows",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 15 Nov 2021 16:09:26 GMT",
5
+ "date": "Mon, 22 Nov 2021 16:09:45 GMT",
6
+ "tag": "react-native-windows_v0.66.5",
7
+ "version": "0.66.5",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "comment": "Fix C# Module Event invocation",
12
+ "author": "vmorozov@microsoft.com",
13
+ "commit": "f5e0d1f8184cabdf83784ad272f7b82680b117cf",
14
+ "package": "react-native-windows"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Mon, 15 Nov 2021 16:09:53 GMT",
6
21
  "tag": "react-native-windows_v0.66.4",
7
22
  "version": "0.66.4",
8
23
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,18 +1,26 @@
1
1
  # Change Log - react-native-windows
2
2
 
3
- This log was last generated on Mon, 15 Nov 2021 16:09:26 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 22 Nov 2021 16:09:45 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 0.66.4
7
+ ## 0.66.5
8
8
 
9
- Mon, 15 Nov 2021 16:09:26 GMT
9
+ Mon, 22 Nov 2021 16:09:45 GMT
10
10
 
11
11
  ### Patches
12
12
 
13
- - Fix crash loading bundle in win32 (julio.rocha@microsoft.com)
14
- - Drop ChakraCore dependency (#9056) (julio.rocha@microsoft.com)
13
+ - Fix C# Module Event invocation (vmorozov@microsoft.com)
15
14
 
15
+ ## 0.66.4
16
+
17
+ Mon, 15 Nov 2021 16:09:53 GMT
18
+
19
+ ### Patches
20
+
21
+ - Fix crash loading bundle in win32 (julio.rocha@microsoft.com)
22
+ - Drop ChakraCore dependency (#9056) (julio.rocha@microsoft.com)
23
+
16
24
  ## 0.66.3
17
25
 
18
26
  Mon, 01 Nov 2021 19:10:27 GMT
@@ -375,7 +375,7 @@ namespace Microsoft.ReactNative.Managed.CodeGen
375
375
  {
376
376
  // generates:
377
377
  // moduleBuilder.AddInitializer((IReactContext reactContext) =>
378
- // module.MyEvent = (ArgType0 arg0, ArgType1 arg1, ...) => reactContext.EmitJsEvent("eventEmitterName", "eventName", arg0, arg1, ...);
378
+ // module.MyEvent = (ArgType0 arg0, ArgType1 arg1, ...) => new ReactContext(reactContext).EmitJsEvent("eventEmitterName", "eventName", arg0, arg1, ...);
379
379
  return InvocationStatement(
380
380
  MemberAccessExpression(ReactNativeNames.ModuleBuilder, ReactNativeNames.AddInitializer),
381
381
  ParenthesizedLambdaExpression(
@@ -389,7 +389,7 @@ namespace Microsoft.ReactNative.Managed.CodeGen
389
389
  {
390
390
  // generates:
391
391
  // moduleBuilder.AddInitializer((IReactContext reactContext) =>
392
- // module.MyEvent = (ArgType0 arg0, ArgType1 arg1, ...) => reactContext.EmitJsFunction("moduleName", "eventName", arg0, arg1, ...);
392
+ // module.MyEvent = (ArgType0 arg0, ArgType1 arg1, ...) => new ReactContext(reactContext).EmitJsFunction("moduleName", "eventName", arg0, arg1, ...);
393
393
  return InvocationStatement(
394
394
  MemberAccessExpression(ReactNativeNames.ModuleBuilder, ReactNativeNames.AddInitializer),
395
395
  ParenthesizedLambdaExpression(
@@ -411,7 +411,7 @@ namespace Microsoft.ReactNative.Managed.CodeGen
411
411
  block: null,
412
412
  expressionBody: InvocationExpression(
413
413
  MemberAccessExpression(ReactNativeNames.Module, Identifier(initializer.Method.Name)),
414
- ObjectCreationExpression(ReactTypes.ReactContext, IdentifierName((ReactNativeNames.ReactContextLocalName)))
414
+ ObjectCreationExpression(ReactTypes.ReactContext, IdentifierName(ReactNativeNames.ReactContextLocalName))
415
415
  )));
416
416
  }
417
417
 
@@ -420,7 +420,8 @@ namespace Microsoft.ReactNative.Managed.CodeGen
420
420
 
421
421
  var lambdaParams = new List<ParameterSyntax>(callback.CallbackParameters.Length);
422
422
  var arguments = new List<ArgumentSyntax>(callback.CallbackParameters.Length);
423
- arguments.Add(Argument(IdentifierName(ReactNativeNames.WriterLocalName)));
423
+ arguments.Add(Argument(LiteralExpression(callback.CallbackContextName)));
424
+ arguments.Add(Argument(LiteralExpression(callback.Name)));
424
425
 
425
426
  for (int i = 0; i < callback.CallbackParameters.Length; i++)
426
427
  {
@@ -433,10 +434,10 @@ namespace Microsoft.ReactNative.Managed.CodeGen
433
434
 
434
435
  // generates:
435
436
  // module.<callackName> = (ArgType0 arg0, ArgType1 arg0, ...) =>
436
- // reactContext.<contextCallbackMethod>(
437
+ // new ReactContext(reactContext).<contextCallbackMethod>(
437
438
  // eventEmitterName,
438
439
  // eventName,
439
- // writer => writer.WriteArgs(arg0, arg1, ...)
440
+ // arg0, arg1, ...
440
441
  // )
441
442
  return
442
443
  AssignmentExpression(
@@ -446,16 +447,11 @@ namespace Microsoft.ReactNative.Managed.CodeGen
446
447
  parameterList: ParameterList(lambdaParams.ToArray()),
447
448
  block: null,
448
449
  expressionBody: InvocationExpression(
449
- MemberAccessExpression(ReactNativeNames.ReactContextLocalName, contextCallbackMethod),
450
- LiteralExpression(callback.CallbackContextName),
451
- LiteralExpression(callback.Name),
452
- ParenthesizedLambdaExpression(
453
- parameterList: ParameterList(Parameter(ReactNativeNames.WriterLocalName)),
454
- block: null,
455
- expressionBody: InvocationExpression(
456
- MemberAccessExpression(ReactTypes.JSValueWriter, ReactNativeNames.WriteArgsMethodName),
457
- arguments
458
- )))));
450
+ MemberAccessExpression(
451
+ ObjectCreationExpression(ReactTypes.ReactContext, IdentifierName(ReactNativeNames.ReactContextLocalName)),
452
+ contextCallbackMethod),
453
+ arguments
454
+ )));
459
455
  }
460
456
 
461
457
  private string GetMethodReturnTypeFromStyle(ReactMethod.MethodReturnStyle returnStyle)
@@ -38,20 +38,28 @@ namespace Microsoft.ReactNative.Managed.CodeGen
38
38
  return InvocationStatement(SyntaxFactory.IdentifierName(methodName), arguments);
39
39
  }
40
40
 
41
- internal static ExpressionSyntax MemberAccessExpression(SyntaxToken instance, SyntaxToken method)
41
+ internal static ExpressionSyntax MemberAccessExpression(ExpressionSyntax instance, SyntaxToken member)
42
+ {
43
+ return SyntaxFactory.MemberAccessExpression(
44
+ SyntaxKind.SimpleMemberAccessExpression,
45
+ instance,
46
+ SyntaxFactory.IdentifierName(member));
47
+ }
48
+
49
+ internal static ExpressionSyntax MemberAccessExpression(SyntaxToken instance, SyntaxToken member)
42
50
  {
43
51
  return SyntaxFactory.MemberAccessExpression(
44
52
  SyntaxKind.SimpleMemberAccessExpression,
45
53
  SyntaxFactory.IdentifierName(instance),
46
- SyntaxFactory.IdentifierName(method));
54
+ SyntaxFactory.IdentifierName(member));
47
55
  }
48
56
 
49
- internal static ExpressionSyntax MemberAccessExpression(ISymbol type, SyntaxToken method)
57
+ internal static ExpressionSyntax MemberAccessExpression(ISymbol type, SyntaxToken member)
50
58
  {
51
59
  return SyntaxFactory.MemberAccessExpression(
52
60
  SyntaxKind.SimpleMemberAccessExpression,
53
61
  type.ToTypeSyntax(),
54
- SyntaxFactory.IdentifierName(method));
62
+ SyntaxFactory.IdentifierName(member));
55
63
  }
56
64
 
57
65
  internal static StatementSyntax LocalDeclarationStatement(ISymbol type, SyntaxToken variableName, ExpressionSyntax initializer)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.66.4",
3
+ "version": "0.66.5",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",