Open ayazhafiz opened 1 year ago
To clarify @ayazhafiz, do we need an opaque type that lives in crates/compiler/builtins/roc
, it fully implements the Encode and Decode abilities, and replaces Json in the relevant tests in crates/compiler/test_gen/src/gen_abilities.rs
and crates/compiler/test_mono/src/tests.rs
?
Should this type be a builtin or can it live somewhere else? I assume we don't want it to show up in docs generation or accidentally shadow another module.
As discussed in private communication, this module need not be in the builtins. A string representation used in the tests will do. m
Can I take this ticket? I've got a PR ready #6845
Today we have a
Json
module in the builtins that should not exist there longer-term. We'd like to move the JSON module to user space.Removing Json is not as simple as deleting the file because many compiler-internal tests rely on the existence of the module for testing abilities.
So, the first step of this issue will be creating a synthetic encoder/decoder implementation that those tests can use inside of the compiler itself (this can just be a raw string that implement a Roc encoder/decoder faithfully), and updating all tests that depend on Json to use that module instead.