A more user-friendly API
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- backend
Research direction
Start by reviewing the library's current encode and decode entry points and how they relate to JSON.parse and JSON.stringify. Define the public API and schema behavior needed for one-step calls, including preservation of object values and deep equality between the encoded input and decoded output.
Written by the indexing model from the issue text.
Description
Is anyone here opposed to maybe adding a more user-friendly API to this library.
Right now it takes a fair amount of boilerplate to do what is essentially JSON.parse(encoded) or JSON.stringify(obj).
Plus, there doesn't seem to be a way to get the same objects out on the decode end as were put into the encoding step. This means even more boilerplate code to translate certain fields from numbers into enum strings. Considering this is probably the most common use case it seems worth it to make this a simple one-step call like buffer = encode(schema, obj) and obj = decode(schema, buffer). And preferably, the input to encode and the output of decode should have deep equality.
- Dominant language
- JavaScript
- Stars
- 881
- Forks
- 113
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mapbox/pbf
-
question
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
bug question
Difficulty 4/5 3-5 days Newbie friendliness 40/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·