Closed Theoistic closed 3 years ago
If you are targeting .NET 3.1 , the old 3.0.8 blazor.polyfill.js file that you can find in release and also on NPM should be sufficient, as it was indeed targeting .NET 3.1.
Is there something not available in 3.0.8 version ?
.NET 5.0 support has needed a whole NuGet package because polyfilling was not just sifficient by default, so the build and embedding method has been changed. There is some code change on the fly in blazor.server.js for .NET 5.0, in order to ideally support multiple version or revision of .NET 5.0 instead of shipping an already modified blazor.server.js version that would need manual change at each release.
Of course things may break up and need change or additional things in the future.
Can you validate that the 3.0.8 release version is working in your environment ? Old doc can be read here: https://github.com/Daddoon/Blazor.Polyfill/blob/08e7407d283c2b8842a50b227ee18451ff509396/README.md
If everything is working as expected, i will write a notice on the current README page for people looking for the .NET Core 3.1 version support.
Also, i don't know the possible side-effect on .NET Core 3.1 if downgrading the current .NET 5.0 release, as the actives changes were targeting .NET 5.0 specific new issues.
It is possible that it will work out of the box, but i mean, it's like the library will try to find and fix things that does not even exist in .NET 3.1 and that was not even needed to be changed for .NET 3.1.
The only intended solution for .NET 3.1 was the Blazor.Polyfill 3.0.8 release, newest releases are targeting .NET 5.0.
i managed to just download the repo and target .net 3.1 and create a local nupgk, and install it from disk. from what i saw in the source, you shouldnt need to target that high a framework for said features to be net 5 compatible. and all the referenced dependencies only requires .net core 3.0+ so you could go that low even. Its always handy to take the newest version from git, due to a lot of minor bug fixes might be lost if we get stuck with an old release.. ;)
i managed to just download the repo and target .net 3.1 and create a local nupgk, and install it from disk. from what i saw in the source, you shouldnt need to target that high a framework for said features to be net 5 compatible. and all the referenced dependencies only requires .net core 3.0+ so you could go that low even. Its always handy to take the newest version from git, due to a lot of minor bug fixes might be lost if we get stock with an old release.. ;)
I understand what you implie and i'm aware of it.
The main problem if i try to support .NET Core 3.1 and .NET 5.0 at the same time, by also downgrading the requirement, is that the executing application must have clue of wich blazor.server.js version is running.
Of course, maybe one workaround would be to detect what is the current executing .NET runtime OR allowing multi-targeting at build-time, and so be dependant of some built values in order to distinguish.
In one case, we must mimic the old behavior, by only returning polyfill library (but with the new way) and keeping returning the original blazor.server.js. So not altering anything. I'm not even sure that the JS library is located in the same place as .NET Core 3.1 was a little different about all the "_framework" things, but maybe i'm wrong and it was only about the WASM implementation.
In the other case, the current behavior.
Of course, allowing theses kind of requirement would also make a less library dependant package for .NET Core 3.1, as ReactJS for Babel and all theses other things would not be needed.
Just curious, but is there a reason that prevent you to go to .NET 5.0 ?
Could you downgrade from .net 5 or at least make it possible to run .net core 3.1 .. I just downloaded the solution and am trying to build it cuz changing the framework version just to support IE11 seems a bit drastic.