electricessence / TypeScript.NET

A JavaScript-Friendly .NET Based TypeScript Library (Moved)
https://github.com/electricessence/TypeScript.NET-Core
Other
251 stars 36 forks source link

System.Xml.Linq #13

Open agnauck opened 9 years ago

agnauck commented 9 years ago

would like to see system.Xml.Linq in the awesome library. maybe this code can be integrated: http://ltxmljs.codeplex.com/

electricessence commented 9 years ago

Ok!

electricessence commented 9 years ago

https://github.com/electricessence/TypeScript.NET/tree/develop-%28System.Xml.Linq%29 Feel free to track this branch. I've done the initial setup to get going. I'll definitely work on it, but if you want to help, please do!

electricessence commented 9 years ago

Making progress. Classes are getting their inheritance structure. Still a lot of work to do.

agnauck commented 9 years ago

what is the best way to contribute? I sent a small pull request yesterday, not sure if thats the best way.

electricessence commented 9 years ago

Well I've got some pretty good momentum right now. The best way to contribute is to code review. Ask questions. Challenge assumptions. It's pretty ragged right now, but things are unfolding well. I'm really for looking at the .NET source and comparing the code to make sure we are following their assumptions.

electricessence commented 9 years ago

Also, I didn't see any pull request.

electricessence commented 9 years ago

@agnauck: Ok. Made a significant milestone that you could definitely help. I just checked in XObject and I'm confident it is analogous with the C#.NET version. I will assign you a task. :)

agnauck commented 9 years ago

what are you plans for serializing and parsing.

Write: 1) Implement the .NET XmlWriter 2) use a custom simple XmlWriter? 3) use some other existing js or ts lib

Parse: 1) use the browsers DOMParser like ltxml.js does 2) use sax.js 3) use something custom, which is quite a challenge ;-)

electricessence commented 9 years ago

The XmlWriter will be deferred as long as possible. But my philosophy is this: A class should work as well or better than it's .NET counterpart. The API should either be the same or at least be very very close. Leveraging a browser based parser may exclude being able to use it with Node.js.

Right now, everything is unraveling itself. Meaning, although very difficult, dependencies are being implemented step by step. It's a lot of work, but I enjoy the challenge and I learn a lot.

For example, right now I'm implementing XsdDuration which is an internal dependency for XmlConvert. Seems overkill but I'm simply pushing forward. At first I was quite afraid of the amount of daunting work. But I believe I can slowly and steadily make this happen.

Its to the extent that I was considering writing my own C# parser that would transform C# into TS. For the moment I am using a set of Regex replace patterns to get me closer to the result. https://gist.github.com/electricessence/b575f18dc184beb5cc69

electricessence commented 8 years ago

Update: Will take some more time before I start migrating the Xml namespace into the master branch. Changing to AMD became a priority but this is definitely on the horizon.

electricessence commented 8 years ago

Update: the traverse methods have been updated with better typing. Work well with node walking.