Skip to content

Get rid of encoding/decoding #197

@jfmengels

Description

@jfmengels

This package supports parsing Elm code from a String to an AST, but it also supports encoding/decoding the AST to JSON.

In practice, I find that this encoding/decoding works is context-dependent. For instance, for elm-review, we switched to using a custom codec using (a vendored version of) elm-serialize which transforms into bytes (or something close to it).

This project has never had a guarantee that the same AST will be encoded/decoded correctly across versions. For instance, an AST encoded using v7.2.8 might not be decoded correctly using v7.2.9., which can be problematic and surprising to some consumer projects.

My proposal is to get rid of this feature of the project. Removing the JSON part of this package would remove the complexity of the package and remove some dependencies, it will also remove some modules that are in practice almost only there because of the JSON part (Elm.Syntax.Comments for instance). It will also let users decide how to handle this part when the version of the package changes, instead of hoping that it will be compatible.

I don't know if we should have a gist explaining how to do the JSON transformation which people can then adapt, or whether we should release this in a separate package still.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions