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

Not compatible with netcoreapp3.1/netstandard2.1 target #43

Closed
fradav opened this issue May 2, 2020 · 14 comments
Closed

Not compatible with netcoreapp3.1/netstandard2.1 target #43

fradav opened this issue May 2, 2020 · 14 comments

Comments

@fradav
Copy link
Contributor

fradav commented May 2, 2020

When I choose netcoreapp3.1 target, Fable compilation fails with:

The type 'System.IAsyncDisposable' does not match the type 'IAsyncDisposable

Reverting to netstandard2.0 works.

@fradav fradav changed the title Not compatible with netcoreapp3.1 target Not compatible with netcoreapp3.1/netstandard2.1 target May 2, 2020
@dbrattli
Copy link
Owner

dbrattli commented May 3, 2020

Yes, IAsyncDisposable is now included so we should use that one instead for netcore. https://docs.microsoft.com/en-us/dotnet/api/system.iasyncdisposable?view=netcore-3.1

@fradav
Copy link
Contributor Author

fradav commented May 4, 2020

Unfortunately, the new DisposeAsync returns a ValueTask not an Async. Just avoid the namespace conflict should be the most sensible?

@dbrattli
Copy link
Owner

dbrattli commented May 4, 2020

Yes, that is probably the the most sensible. Have been working so much with Oryx and Task lately that I've forgot for a moment that AsyncRx is Async 😄.

@fradav
Copy link
Contributor Author

fradav commented May 6, 2020

I see you updated AsyncRx, but you didn't change the name of the interface, so it's still a potential clash and we have to carefully fully qualify everywhere we make an "open System" (and that is often...)
Perhaps it's asking a lot, but would you mind to change IAsyncDisposable for IFSharpAsyncDisposable for example ? I really think it's more future proof.

@dbrattli
Copy link
Owner

dbrattli commented May 7, 2020

The other option I'm considering is to rewrite the library to Task and use IAsyncDisposable when available. I just need to figure out how to handle this in Fable, but it should map better to promise anyways.

@fradav
Copy link
Contributor Author

fradav commented May 7, 2020

Pardon my ignorance but what's the advantages of Task over Async, other than the former is ubiquitous in .net ecosystem?

@dbrattli
Copy link
Owner

dbrattli commented May 7, 2020

@fradav
Copy link
Contributor Author

fradav commented May 7, 2020

Ok, I didn't know about performance improvements. What do you think about this https://github.com/pimbrouwers/falco over giraffe ?

@dbrattli
Copy link
Owner

dbrattli commented May 7, 2020

Haven't tried it. But looking at the data-types of Falco I can see that Giraffe has another trick up its sleeve and uses continuations to improve the speed further: https://medium.com/@gerardtoconnor/carry-on-continuation-over-binding-pipelines-for-functional-web-58bd7e6ea009

@dbrattli
Copy link
Owner

dbrattli commented May 7, 2020

I use the same trick to speed up Async vs Sync handling for maps and filters i.e https://github.com/dbrattli/Fable.Reaction/blob/master/AsyncRx/src/Transform.fs#L10

Thus map and mapAsync uses the same implementation, without map having to get any penalty for being sync.

@fradav
Copy link
Contributor Author

fradav commented May 10, 2020

Did you see that : fsharp/fslang-suggestions#866 ?

@dbrattli
Copy link
Owner

dbrattli commented May 13, 2020

Added suggested fix: https://github.com/dbrattli/Fable.Reaction/blob/master/AsyncRx/src/Builder.fs#L39

Name of interface renamed to IAsyncRxDisposable.

@dbrattli
Copy link
Owner

Closing as this issue should be fixed. Please re-open if you find any problems.

@fradav
Copy link
Contributor Author

fradav commented May 14, 2020

Everything works fine, many thanks!
Thanks also for this neat and cleanly designed Fable library. I must admit it is the main reason I'm sticking with Fable/F# for frontend projects.
I think it is a very nice implementation of the meiosis pattern

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