You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,15 @@ The interop project can be found in the [canhorn/EventHorizon.Blazor.Interop](ht
28
28
*[TypeScript](https://www.typescriptlang.org/)
29
29
*[NodeJS](https://nodejs.org/)
30
30
31
+
## TypeScript Parser
32
+
33
+
The generation relies heavily on the TypeScript Abstract Syntax Tree and so the code includes ways to parse the source files into a AST representation for easier generation.
34
+
35
+
The code has two supported parser types, .NET and NodeJS, to do realtime parsing of code. Using a .NET library it's able to do very quick parsing, but since it has not been maintained it can not handle complex or modern TypeScript syntax.
36
+
But with the NodeJS TypeScript parser it can handle modern more complex TypeScript syntax, but with the trade off of in speed.
37
+
38
+
> Having NodeJS installed is required to use the NodeJS TypeScript parser. (This is required when using the parser with the Tool)
Copy file name to clipboardExpand all lines: Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/Identifiers/InterfaceResponseTypeIdentifierTests.cs
-a, --project-assembly <project-assembly> | The project name of the Assembly that will be generated | Default: "Generated.WASM"
20
20
-l, --project-generation-location <project-generation-location> | The directory where the Generated Project assembly will be saved | Default: "_generated"
21
21
-f, --force | This will force generation, by deleting --project-generation-location | Default: (False)
22
+
-p, --parser | The type of TypeScript parser to use, Supported values: ("dotnet","nodejs") | Default: ("dotnet")
23
+
24
+
## Parsers
25
+
26
+
The tool supports two types of parsers, one using the embedded .NET parser and one using NodeJS the TypeScript Complier.
27
+
28
+
These both have trade offs:
29
+
30
+
Type | Details
31
+
--- | ---
32
+
dotnet | Has no external dependencies, and on average 3x faster than the nodejs parser. A con is that it does not support modern TypeScript syntax, but should coverage 90% of use-cases.
33
+
nodejs | Requires NodeJS to function, supports modern TypeScript syntax. A con is that it is very slow relative to the dotnet parser.
0 commit comments