Design strategies for class libraries that span Javascript and C #

I implement some objects that will have an equal amount of wealth both on the client side and on the server side.

In this particular case, I will build (hopefully) a small class library to work with search tokens. As an example of pseudocode, I want to be able to do the equivalent of the following both in Javascript and on the server (C # in my case).

s = new SearchTokenList();
s.Add(new SearchToken(field, value, negation));

What development strategies can help avoid creating a big ball of dirt for a library that should cover C # and Javascript?

Update: Finding more strategies than mechanics. But I will take any guidance that I can get from those who have previously done such things.

+3
source share
4 answers

Take a look at Nikhil Kothari's Script # can help you. This is a C # compiler in JavaScript.

+3
source

I think you should check out my C # compiler for JavaScript at http://jsc.sourceforge.net/

Unlike Script #, my jsc compiler runs at the MSIL level.

WPF example: AvalonExampleGallery alt text http://jsc.sourceforge.net/examples/avalon/assets/AvalonExampleGallery/Preview.png

Contact me if you have any specific questions.

+3
source

, JSON XML . , WCF JavaScript- . . .NET : WCF Javascript.

+1

Javascript .NET Microsoft JScript.NET - /target:library , CLS

[assembly:System.CLSCompliant(true)]

CLS. , , () JS- ( #) ( JS) .

0

Source: https://habr.com/ru/post/1709337/


All Articles