Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving it to .net standard (1.2 because of .net framework 4.5.1) #1

Open
aochmann opened this issue Mar 5, 2020 · 2 comments
Open

Comments

@aochmann
Copy link
Contributor

aochmann commented Mar 5, 2020

IMO we should move it to .net standard (it will help us with future .net core movement and re-use it in another project that are not Umbraco related) and rewrite the Umbraco extension for TryConvertTo. I saw implementation and lot of logic use internal (.net) mechanism, but just the model Attempt comes from Umbraco.

We can also look at:

Here Umbraco code base links:

Or we can find another way, not using TryConvert -> maybe some another library.

What do you think guys @trt @mzajkowski

@aochmann aochmann changed the title Moving it to .net standard (1.2 because of .net framework 4.5.2) Moving it to .net standard (1.2 because of .net framework 4.5.1) Mar 5, 2020
@aochmann
Copy link
Contributor Author

aochmann commented Mar 6, 2020

IMO we should delete the Umbraco tryConvert (possible no updates there or hard to maintenance) and use just GetConverter. It has lots of converters and we have abilities to create our own - https://www.hanselman.com/blog/TypeConvertersTheresNotEnoughTypeDescripterGetConverterInTheWorld.aspx

Also played with library TypeConvert (https://github.com/deniszykov/typeconvert) and here's the performance:

  • tryConvert - 00:00:00.0100070
  • GetConverter - 00:00:00.0009975
  • TypeConvert - 00:00:00.2069999

We can perfom try catch on GetConverter to handle all not supported converters.

When we will do it by removing Umbraco dependency then we would use this library everywhere -> .net standard.

@mzajkowski
Copy link

I think it's a very good idea (removing dependency from Umbraco + being .net independent). The only thing which spotted my eye and made me conscious is if we should go that granular with the libraries 🤔

I mean "Configuration" for example vs. "Essentials" (or whatever else naming we can set there). It's good to have a division into domains/logical sets of features and functionalities, but ending up with 100 libraries with 1 class in each is not the desired destination I presume.

TBD for sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants