Giter Site home page Giter Site logo

fs2-dom's Introduction

fs2-dom's People

Contributors

2chilled avatar armanbilge avatar buntec avatar nimble-agar-steward[bot] avatar yilinwei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fs2-dom's Issues

Remove Circe dependency

It is currently used here, to automatically derive a Serializer when a circe Encoder/Decoder are in scope. I added this for convenience.

implicit def fromCirceCodec[F[_], A](implicit
F: Sync[F],
decoder: Decoder[A],
encoder: Encoder[A]
): Serializer[F, A] = new Serializer[F, A] {
def serialize(a: A): F[js.Any] = F.delay(a.asJsAny)
def deserialize(serialized: js.Any): F[A] = decodeJs[A](serialized).liftTo[F]
}

While this is convenient, it is not a good long term solution. Namely:

  1. Circe Json represents only a subset of serializable data structures. For example JS ArrayBuffer is serializable, but there is no way to express this in Json.
  2. Circe Json also models stuff we can't serialize. For example, a JsonNumber maybe be arbitrarily large; however JavaScript-native numbers must be representable as Double.
  3. Circe is still unstable, 0.15.x is currently in the works.

It's annoying, but what we need is our own infrastructure for deriving Serializers from data classes. We can use shapeless 3, and maybe take inspiration from Dynosaur.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.