Comments (3)
There was consensus on the TC39 Incubator call to not provide keys
in this proposal unless a significant use case is identified. This functionality is potentially valuable for practitioners, but can be easily added to the proposal or a followup.
In order to inform decisions around such an addition and address concerns about memory pressure, implementations should collect statistics about use of JSON.parse
with large input and a reviver function. Parallels were also drawn to the currently-Stage-3 RegExp Match Indices proposal.
from proposal-json-parse-with-source.
We're having a defined use case for this. Which is "sorta" implemented here: https://github.com/haoadoresorange/when-json-met-bigint
The roundtrip example in the README of this proposal will fail if the number is within the range for number
type. In the repo above we allow the use of a "schema" to enforce such roundtrip.
from proposal-json-parse-with-source.
As an implementer, I'm a bit concerned about adding more overhead (performance, complexity) for this relatively niche use case.
Maybe this could be a follow-up proposal, since it's strictly an addition (adding another property to the context object)?
from proposal-json-parse-with-source.
Related Issues (20)
- Expose position and/or input of source text? HOT 12
- Extend this proposal to include serialization? HOT 10
- Advance to stage 3 HOT 3
- Advance to stage 4 HOT 3
- performance impact with 1-million json.parse calls HOT 1
- bigint ergonomics of user-function vs options-object HOT 1
- bikeshedding the mechanism for serialization HOT 7
- Reusability of raw serialization mechanism HOT 2
- Should reviver functions still get a context argument for non-primitive values? HOT 1
- Naming of raw text placeholder
- Stage 3 Specification Review: Michael Ficarra HOT 1
- Stage 3 Specification Review: Waldemar Horwat HOT 2
- How to parse bigints when using Response.json() function? HOT 2
- Assert failed for typedValNode is an ObjectLiteral Parse Node
- Are there any implementations yet? HOT 2
- Bug in `intToBigInt`? HOT 2
- Reviver can modify holder object, like inserting new object / array, which breaks invariant of parsing information HOT 6
- A polyfill/ponyfill implementation HOT 11
- How to reference JSON parse nodes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proposal-json-parse-with-source.