rescript-lang.org icon indicating copy to clipboard operation
rescript-lang.org copied to clipboard

Add Js.Json.deserializeUnsafe and Js.Json.serializeExn to the docs

Open kevanstannard opened this issue 5 years ago • 6 comments

It looks like Js.Json.deserializeUnsafe and Js.Json.serializeExn are not currently in the docs.

https://rescript-lang.org/docs/manual/latest/api/js/json

Should they be added? Or perhaps intentionally omitted?

kevanstannard avatar Jan 26 '21 00:01 kevanstannard

i am not sure tbh, these functions were prematurely added and IMO it's not entirely clear if it's a api that should be used... but if you find it useful, I'd be willing to review a PR

ryyppy avatar Jan 28 '21 22:01 ryyppy

Thanks @ryyppy

I did see these mentioned in the forum a few weeks back, which prompted me to open the ticket, but I'm happy to be guided by the recommendation of you and the team.

Feel free to close this ticket if you feel more discussion on those functions is needed first.

Alternatively I am happy to document, and perhaps include a note that these functions may change or be removed in a future version of ReScript?

kevanstannard avatar Feb 02 '21 05:02 kevanstannard

@kevanstannard yeah, feel free to give it a shot and add a note that this functionality should not be relied on too heavily for two reasons: 1) It is an easy way out for a complex problem and might only work for simple cases and 2) I am not too sure if this functionality should further exist (right now I am pretty sure nobody depends on it, so it's easy for us to remove / change later on).

ryyppy avatar Feb 02 '21 07:02 ryyppy

@ryyppy OK if we close this issue now?

kevanstannard avatar Sep 02 '21 06:09 kevanstannard

As discussed in PR, better to leave these undocumented for now.

kevanstannard avatar Sep 04 '21 19:09 kevanstannard

@kevanstannard yeah, thanks. Sorry for my slow response times. Gonna be better in the next few weeks!

ryyppy avatar Sep 07 '21 08:09 ryyppy