Increase the syntaxtoken size to 10 parameters (#13477)

* Increase the size to 8 parameters

* Introduce a unittest for codegen

* Change files

* Increase the params to 10

* Delete vnext/Microsoft.ReactNative.Managed.CodeGen.UnitTests/CodeGen/Lkg/Microsoft.ReactNative.Managed.CodeGen.UnitTests.CodeGen.CodeGenMethodTests--EightParamReturnInt--Sync.lkg

* Delete vnext/Microsoft.ReactNative.Managed.CodeGen.UnitTests/CodeGen/Lkg/Microsoft.ReactNative.Managed.CodeGen.UnitTests.CodeGen.CodeGenMethodTests--EightParamReturnInt--Async.lkg
This commit is contained in:
Sharath Manchala 2024-07-24 10:25:36 -07:00 коммит произвёл GitHub
Родитель 059f0ee551
Коммит 9ddfc2505e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
6 изменённых файлов: 40 добавлений и 74 удалений

Просмотреть файл

@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Increase method effective parameters to 8",
"packageName": "react-native-windows",
"email": "10109130+sharath2727@users.noreply.github.com",
"dependentChangeType": "patch"
}

Просмотреть файл

@ -49,6 +49,12 @@ namespace Microsoft.ReactNative.Managed.CodeGen.UnitTests.CodeGen
TestMethod("public int Method(int x, string y, double z) { return 42; }", ReactMethod.MethodReturnStyle.ReturnValue);
}
[TestMethod]
public void TenParamReturnInt()
{
TestMethod("public int Method(int a, string b, int c, string d, double e, string f, int g, double h, string i, int j) { return 42; }", ReactMethod.MethodReturnStyle.ReturnValue);
}
[TestMethod]
public void ReadOnlyListOfStringParamReturnReadOnlyList()
{

Просмотреть файл

@ -0,0 +1,6 @@
moduleBuilder.AddMethod("MyMethod", global::Microsoft.ReactNative.MethodReturnType.Callback, (global::Microsoft.ReactNative.IJSValueReader reader, global::Microsoft.ReactNative.IJSValueWriter writer, global::Microsoft.ReactNative.MethodResultCallback resolve, global::Microsoft.ReactNative.MethodResultCallback reject) =>
{
global::Microsoft.ReactNative.Managed.JSValueReader.ReadArgs(reader, out int arg0, out string arg1, out int arg2, out string arg3, out double arg4, out string arg5, out int arg6, out double arg7, out string arg8, out int arg9);
int result = module.Method(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
resolve(global::Microsoft.ReactNative.Managed.JSValueWriter.WriteArgs(writer, result));
});

Просмотреть файл

@ -0,0 +1,6 @@
moduleBuilder.AddSyncMethod("MyMethod", (global::Microsoft.ReactNative.IJSValueReader reader, global::Microsoft.ReactNative.IJSValueWriter writer) =>
{
global::Microsoft.ReactNative.Managed.JSValueReader.ReadArgs(reader, out int arg0, out string arg1, out int arg2, out string arg3, out double arg4, out string arg5, out int arg6, out double arg7, out string arg8, out int arg9);
int result = module.Method(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
global::Microsoft.ReactNative.Managed.JSValueWriter.WriteValue(writer, result);
});

Просмотреть файл

@ -86,10 +86,14 @@ namespace Microsoft.ReactNative.Managed.CodeGen
public static readonly SyntaxToken Arg4LocalName = Identifier("arg4");
public static readonly SyntaxToken Arg5LocalName = Identifier("arg5");
public static readonly SyntaxToken Arg6LocalName = Identifier("arg6");
public static readonly SyntaxToken Arg7LocalName = Identifier("arg7");
public static readonly SyntaxToken Arg8LocalName = Identifier("arg8");
public static readonly SyntaxToken Arg9LocalName = Identifier("arg9");
public static readonly SyntaxToken[] ArgLocalNames = new SyntaxToken[] {
Arg0LocalName, Arg1LocalName, Arg2LocalName, Arg3LocalName,
Arg4LocalName, Arg5LocalName, Arg6LocalName,
Arg4LocalName, Arg5LocalName, Arg6LocalName, Arg7LocalName,
Arg8LocalName, Arg9LocalName
};
public static readonly SyntaxToken Value0LocalName = Identifier("value0");
@ -99,10 +103,14 @@ namespace Microsoft.ReactNative.Managed.CodeGen
public static readonly SyntaxToken Value4LocalName = Identifier("value4");
public static readonly SyntaxToken Value5LocalName = Identifier("value5");
public static readonly SyntaxToken Value6LocalName = Identifier("value6");
public static readonly SyntaxToken Value7LocalName = Identifier("value7");
public static readonly SyntaxToken Value8LocalName = Identifier("value8");
public static readonly SyntaxToken Value9LocalName = Identifier("value9");
public static readonly SyntaxToken[] ValueLocalNames = new SyntaxToken[] {
Value0LocalName, Value1LocalName, Value2LocalName, Value3LocalName,
Value4LocalName, Value5LocalName, Value6LocalName,
Value4LocalName, Value5LocalName, Value6LocalName, Value7LocalName,
Value8LocalName, Value9LocalName
};
}
}

Просмотреть файл

@ -24,21 +24,11 @@
"Microsoft.SourceLink.Common": "1.1.1"
}
},
"boost": {
"type": "Transitive",
"resolved": "1.76.0",
"contentHash": "p+w3YvNdXL8Cu9Fzrmexssu0tZbWxuf6ywsQqHjDlKFE5ojXHof1HIyMC3zDLfLnh80dIeFcEUAuR2Asg/XHRA=="
},
"Microsoft.Build.Tasks.Git": {
"type": "Transitive",
"resolved": "1.1.1",
"contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q=="
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
"resolved": "0.1.21",
"contentHash": "5njCh+3eXTLOv7+8nOnp6nJ5C0r6it5ze54c0nuWleeDptuK8t3dEDB79XTU4D5DKNvAPlqJpgXRDOak5nYIug=="
},
"Microsoft.Net.Native.Compiler": {
"type": "Transitive",
"resolved": "2.2.7-rel-27913-00",
@ -63,30 +53,17 @@
"Microsoft.NETCore.Platforms": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "ok+RPAtESz/9MUXeIEz6Lv5XAGQsaNmEYXMsgVALj4D7kqC8gveKWXWXbufLySR2fWrwZf8smyN5RmHu0e4BHA=="
"contentHash": "GmkKfoyerqmsHMn7OZj0AKpcBabD+GaafqphvX2Mw406IwiJRy1pKcKqdCfKJfYmkRyJ6+e+RaUylgdJoDa1jQ=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
"resolved": "1.1.1",
"contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg=="
},
"Microsoft.UI.Xaml": {
"type": "Transitive",
"resolved": "2.8.0",
"contentHash": "vxdHxTr63s5KVtNddMFpgvjBjUH50z7seq/5jLWmmSuf8poxg+sXrywkofUdE8ZstbpO9y3FL/IXXUcPYbeesA==",
"dependencies": {
"Microsoft.Web.WebView2": "1.0.1264.42"
}
},
"Microsoft.Web.WebView2": {
"type": "Transitive",
"resolved": "1.0.1264.42",
"contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
},
"NETStandard.Library": {
"type": "Transitive",
"resolved": "2.0.3",
"contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
"contentHash": "548M6mnBSJWxsIlkQHfbzoYxpiYFXZZSL00p4GHYv8PkiqFBnnT68mW5mGEsA/ch9fDO9GkPgkFQpWiXZN7mAQ==",
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0"
}
@ -159,10 +136,7 @@
"contentHash": "qF6RRZKaflI+LR1YODNyWYjq5YoX8IJ2wx5y8O+AW2xO+1t/Q6Mm+jQ38zJbWnmXbrcOqUYofn7Y3/KC6lTLBQ=="
},
"common": {
"type": "Project",
"dependencies": {
"boost": "[1.76.0, )"
}
"type": "Project"
},
"fmt": {
"type": "Project"
@ -170,7 +144,6 @@
"folly": {
"type": "Project",
"dependencies": {
"boost": "[1.76.0, )",
"fmt": "[1.0.0, )"
}
},
@ -179,18 +152,13 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
"Microsoft.JavaScript.Hermes": "[0.1.21, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
"boost": "[1.76.0, )"
"ReactCommon": "[1.0.0, )"
}
},
"reactcommon": {
"type": "Project",
"dependencies": {
"Folly": "[1.0.0, )",
"boost": "[1.76.0, )"
"Folly": "[1.0.0, )"
}
}
},
@ -208,11 +176,6 @@
"runtime.win10-arm.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
}
},
"Microsoft.Web.WebView2": {
"type": "Transitive",
"resolved": "1.0.1264.42",
"contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
},
"runtime.win10-arm.Microsoft.NETCore.UniversalWindowsPlatform": {
"type": "Transitive",
"resolved": "6.2.9",
@ -233,11 +196,6 @@
"runtime.win10-arm-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
}
},
"Microsoft.Web.WebView2": {
"type": "Transitive",
"resolved": "1.0.1264.42",
"contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
},
"runtime.win10-arm-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
"type": "Transitive",
"resolved": "6.2.9",
@ -258,11 +216,6 @@
"runtime.win10-arm64-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
}
},
"Microsoft.Web.WebView2": {
"type": "Transitive",
"resolved": "1.0.1264.42",
"contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
},
"runtime.win10-arm64-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
"type": "Transitive",
"resolved": "6.2.9",
@ -283,11 +236,6 @@
"runtime.win10-x64.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
}
},
"Microsoft.Web.WebView2": {
"type": "Transitive",
"resolved": "1.0.1264.42",
"contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
},
"runtime.win10-x64.Microsoft.NETCore.UniversalWindowsPlatform": {
"type": "Transitive",
"resolved": "6.2.9",
@ -308,11 +256,6 @@
"runtime.win10-x64-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
}
},
"Microsoft.Web.WebView2": {
"type": "Transitive",
"resolved": "1.0.1264.42",
"contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
},
"runtime.win10-x64-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
"type": "Transitive",
"resolved": "6.2.9",
@ -333,11 +276,6 @@
"runtime.win10-x86.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
}
},
"Microsoft.Web.WebView2": {
"type": "Transitive",
"resolved": "1.0.1264.42",
"contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
},
"runtime.win10-x86.Microsoft.NETCore.UniversalWindowsPlatform": {
"type": "Transitive",
"resolved": "6.2.9",
@ -358,11 +296,6 @@
"runtime.win10-x86-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
}
},
"Microsoft.Web.WebView2": {
"type": "Transitive",
"resolved": "1.0.1264.42",
"contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
},
"runtime.win10-x86-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
"type": "Transitive",
"resolved": "6.2.9",