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

Fable integration #59

Open
gusty opened this issue Nov 4, 2018 · 5 comments
Open

Fable integration #59

gusty opened this issue Nov 4, 2018 · 5 comments

Comments

@gusty
Copy link
Member

gusty commented Nov 4, 2018

In theory, this library could be perfectly used in the Fable ecosystem.

Although it allows heavy use of SRTP, it also permits to manually specify a codec combinator, the same way ELM inspired Json libs do.

On top of that, the feature of specifying a single codec would also work without relying on SRTP overload, by specifying a codec for each field.

The last sample code in the readme https://github.com/mausch/Fleece#combinators illustrate this.

There shouldn't be any issue to use this in Fable.

I'm not sure what is required in order to by Fable ready, all I know is that there are no stoppers.

Is there anyone interested in take it there?

CC: @alfonsogarciacaro @wallymathieu

@alfonsogarciacaro
Copy link

I had a quick look at the code, if you don't depend on reflection it should work (there's indeed some reflection support in Fable but it's limited). SRTP should work and has been improved in Fable 2, if you find an edge case we can try to fix it in Fable. Though it's the fist time I see the
GeneralizableValue attribute, not sure if it works in Fable.

If you're using Expecto for the tests I recommend just using some Mocha polyfills as Fable itself does, try to run them with Fable and see what fails.

BTW, there's already a similar JSON library for Fable, Thoth.Json. cc @MangelMaxime

@gusty
Copy link
Member Author

gusty commented Nov 4, 2018

At the moment there is zero reflection code in this library.

The generalizable attribute in that example is a bit exotic, the same effect could be achieved by making it a function accepting () instead. I should update that, it looks more complicated than what really is.

We're not using Expecto here, we use Fuchu, which is actually the original project Expecto was based on. So probably we can run those tests with Fuchu as well.

I had a look a Thoth.Json, it seems to be a minimalistic combinator based library which could be seen as a subset of Fleece if you compare them.

On one side, having a simple library could be convenient. The idea of adding more features to Fleece is that it could integrate better with different libraries, being suitable for different scenarios.

Maybe we can join efforts at some point.

@gusty
Copy link
Member Author

gusty commented Jun 10, 2020

I feel like I'm able to work in a flavor compatible with Fable.
But I wonder is there any user having the possibility to use it in such scenario?
So, we can test the design in a real project.

@wallymathieu
Copy link
Member

This library uses Fuchu for tests. We could adjust Fuchu to run on both Fable and .net.

@alfonsogarciacaro
Copy link

IIRC Expecto uses the same API as Fuchu. What we usually do in that case is map the test declaration so they use a JS test runner like Mocha when compiled by Fable. See this and this.

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

No branches or pull requests

3 participants