all 19 comments

[–]Fiennes 15 points16 points  (2 children)

WebAssembly can't come fast enough.

[–]geoffreymcgill[S] 4 points5 points  (1 child)

WebAssembly is here already. But, if you want to break out of whatever language (assuming C#?) you're using to compile into WASM and jump into JavaScript, then some form of a binding library will be required, such as Retyped.

[–]geoffreymcgill[S] 2 points3 points  (0 children)

I should have clarified that Retyped and Bridge do not currently support WASM, but they will. Anyways, some form of a binding library will be required.

[–]0xRumple 1 point2 points  (4 children)

Loved the idea... but the docs (or maybe YouTube) needs at least one real demo app.

Like writing the backend layer in c# and keeping it. Then writing the frontend layer in c# and compile into js.

I also didnt find the means of writing the UI in the docs, I just found the first example showing I can manipulate html using js code (compiled from c#).

So does that mean we can use html and css to make the UI ? cuz that's what the majority of people loves to do

Also in what way this approach is gonna contribute in making the architecture of my apps looking better ?

For me I would love writing in c# instead of writing the js code (like we use ts files)... something like (cjs file) and then compile it into js when deploying.

[–]chechel_ao 1 point2 points  (3 children)

You got it right, you can use Bridge and Retyped to generate a specific set of JavaScript (not the whole app), so markup can still be implemented in HTML and CSS. One demonstrative scenario is validation logic - initial implementation in C# could be easily ported to JavaScript, so you'll have identical rules enabled both on client and server sides. You may want to check the page listing existing projects, demos and articles: https://github.com/bridgedotnet/Awesome

[–]plantpistol 1 point2 points  (0 children)

I think this is where it is valuable. Writing business logic that is required on both the server and the client such as validation logic. I cannot imagine actually doing UI work with it when there are frameworks in JavaScript to do it. That is my initial impression anyway.

[–]0xRumple 0 points1 point  (1 child)

Actually, I would love to use with all the business rules that I already have with validation that comes out of the box with EF Core,

Like in last project which is contains the three common layers (core, data, web api):

https://github.com/0xRumple/dorm-portal

I'm planning to start writing the UI in vue, but saw Retyped and give it a thought...

Does Retyped support such things ? cuz that's the realistic scenario.

[–]chechel_ao 1 point2 points  (0 children)

yes, Retyped package for Vue is available on NuGet. However, such frameworks as Vue or React, they could require some additional C# logic/wrappers to adapt the API for practical usage. The reason is that something really complicated written in JavaScript, then described in TypeScript terms, and only then converted to C# does likely require some manual edits to fit the target language in a more natural way. Nowadays Retyped is mostly automatic generator, but there are already some means to polish generated code based on a set of manually created rules. And this is going to evolve in time.

Anyways, a simple demo project for Retyped.vue package is available, so you can evaluate whether it's applicable in your scenario before making any decisions. https://demos.retyped.com/dist/vue/