Skip to content

Scala.js classes for results? #276

@rpiaggio

Description

@rpiaggio

In order to reduce the size of Scala.js code, we could add of the option of generating native Scala.js traits/classes to hold query results instead of Scala case classes.

Ideally, these would behave as facades into the JS object of the result, using js.Array instead of List, js.UndefOr instead of Option, etc. We wouldn't even need a Decoder, which means revising the base Query type.

Things that may be tricky:

  • Generating Reusability, Eq and Show instances (we do have all the info to generate them though).
  • Generating lenses. Again, we have everything to generate them, but we would have to clone objects, I don't think the Focus macro would work.

It remains to be seen how much of an improvement this would be, in order to evaluate it it's worth the effort.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions