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

V2 #962

Closed
10 of 18 tasks
egil opened this issue Jan 29, 2023 · 12 comments
Closed
10 of 18 tasks

V2 #962

egil opened this issue Jan 29, 2023 · 12 comments
Milestone

Comments

@egil
Copy link
Member

egil commented Jan 29, 2023

This is the parent issue used to track all the changes we want to include in bUnit v2:

@linkdotnet
Copy link
Sponsor Collaborator

Regarding "Refactor out unneeded abstractions (TBD)" - It would make sense to create a ticket which unifies IRenderFragmentBase,IRenderFragment, ... and friends to one exposing type.

@linkdotnet
Copy link
Sponsor Collaborator

"Remove all GetAwaiter().GetResult()"

We have two options here to evaluate whether or not that helps us:

  • Really, just use async/await everywhere.
  • Or what you already started: Reimplement the renderer from "scratch". It could still lead to issues with async/await because of other reasons.

@linkdotnet
Copy link
Sponsor Collaborator

We might wanna track all breaking changes as well as a small guide how to migrate from v1 to v2

@egil
Copy link
Member Author

egil commented Feb 1, 2023

We might wanna track all breaking changes as well as a small guide how to migrate from v1 to v2

For this, we probably need it as a requirement to merge any PR for v2 that there is an updated section in the change log about the breaking changes, and perhaps also a docs page that has the same content.

@egil
Copy link
Member Author

egil commented Feb 5, 2023

"Remove all GetAwaiter().GetResult()"

We have two options here to evaluate whether or not that helps us:

  • Really, just use async/await everywhere.
  • Or what you already started: Reimplement the renderer from "scratch". It could still lead to issues with async/await because of other reasons.

Some of the design choices in the current renderer is based on the fact that we are using mixing async and sync code, but by and large I do not think a complete rewrite is necessary.

That said, this would cause many side effects too, like the BunitContext.Render methods becoming async.

@egil
Copy link
Member Author

egil commented Feb 5, 2023

I'm considering having V2 target .NET 8 only. The list of changes coming to Blazor in that release is significant, see dotnet/aspnetcore#44984.

@linkdotnet
Copy link
Sponsor Collaborator

Quite some interesting features - let's see what makes the cut.

@linkdotnet
Copy link
Sponsor Collaborator

linkdotnet commented Mar 1, 2023

Maybe another input / proposal from my side:
Currently, we have quite some topics for v2, including some that are currently not listed:

  • Remove GetDiffSinceLastRender and friends
  • Make elements update between rendered via AngleSharp factories
  • PoC - find an abstraction so that the user can mock certain things
  • Only support .NET 8

And there are items I missed ... so all in all kind of a big bang. Version 1 is almost 3 years old and ready to go to kindergarten ;)
The good thing is that with that fact, we have a stable API - but in the future, we could also try to go "fast" in the sense of we have v2 with only a few core features we deem the most important and after another year (or 1.5, you get the idea) we go to v3.

I do think your initial thoughts are a valid package for v2 as is. Depending on what @SteveSandersonMS is cooking, there will be more work to come for .NET 8.

@egil
Copy link
Member Author

egil commented Mar 1, 2023

Thanks, Steven. I prototyped on the AngleSharp factories one, and it turns out it won't work. The hooks available in AngleSharp to control the nodes being created are incomplete, so that approach is unfortunately out of the picture.

The "mock certain things" refers to an abstraction around mocking/faking JSInterop, right? To be honest, considering the time limit we have, that may not make it.

I won't rule out keeping .NET6/.NET7 support around for now, unless there are too many #if in our code.

@linkdotnet linkdotnet added this to the 2.0.0 milestone Mar 5, 2023
@linkdotnet
Copy link
Sponsor Collaborator

With the latest preview 3 of ASP.NET Core, the HtmlRenderer is now publicly available. In the announcement, a simple snippet invokes the renderer in a console application.

For v2 we could evaluate if the HtmlRenderer could be somewhat integrated in bUnit. Unfortunately, a lot of things we need are not available and the class is sealed. So at first glance, it doesn't look viable.

@egil
Copy link
Member Author

egil commented Apr 13, 2023

For v2 we could evaluate if the HtmlRenderer could be somewhat integrated in bUnit. Unfortunately, a lot of things we need are not available and the class is sealed. So at first glance, it doesn't look viable.

Yeah it's not meant for us.

@egil
Copy link
Member Author

egil commented May 3, 2024

Lets track this using the milestone feature instead.

@egil egil closed this as completed May 3, 2024
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

Successfully merging a pull request may close this issue.

2 participants