vital.vim
vital.vim copied to clipboard
WIP: Web.JSON improve to v8
Web.JSON is too old.
Update to vim 8.
...But since json_encode() already exists, is this module unnecessary?
This PR includes these new featues.
- 'allow_nan' setting.
- 'ensure_ascii' setting.
- 'from_encoding' setting.
From my point of view, at least this module should keep backward compatibility while
- People should use
json_encode()instead as you said - That's why there is no positive reason to improve this module
- Code which uses this module uses this module may because of some reason
- People should use
json_encode()instead as you said
Vital.vim is currently (basically) support vim 8.0 or later. So should this module be deprecated? Write to document "deprecated" and "should use json_encode()"?
- That's why there is no positive reason to improve this module
I'm thinking of an implementation that makes the JSON module more flexible like Python's JSON Library.
json_encode() is not-strict and not-flexible.
Should this be a separate module? (eg. Data.JSON or ...)
- Code which uses this module uses this module may because of some reason
Agree
One thing, These are purely bug fixes.
- Convert control chars. (Encoded invalid JSON)
- Convert UTF-16 surrogate pairs. (Can not decode valid JSON)
So should this module be deprecated? Write to document "deprecated" and "should use json_encode()"?
Yeah, I think so but it's just my opinion. Actually, I'm more welcome to remove this module rather than improve/fix because of existnace of json_encode().
I'm thinking of an implementation that makes the JSON module more flexible like Python's JSON Library. json_encode() is not-strict and not-flexible. Should this be a separate module?
Got it. Well, then I think it's better to
- Use different namespace as you said (I'm OK with
Data.JSON) - Remove any codes for backward compatibilities and explain the benefits of using
Data.JSONoverjson_encode()or whatever in help - Apply bug fixes to
Web.JSON(Optional, if you desire)
I'm created #743 that part of bug fixes of this PR.
Closed by https://github.com/vim-jp/vital.vim/pull/743 ?
@mattn
Closed by #743 ?
It's includes only bug fixes that is part of this.
I'm rebased, skip these commits and force pushed.