protocolbuffers / protocolbuffers/protobuf-javascript
JS generator missing jspb.generate_from_object option
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 471
- Forks
- 91
- Avg merge
- 3h 57m
- Merged PRs (30d)
- 2
Description
The comment for jspb.Message.GENERATE_FROM_OBJECT states:
* NOTE: By default no protos actually have a fromObject method. You need to
* add the jspb.generate_from_object options to the proto definition to
* activate the feature.
However, no such option is currently implemented in the open sourced version. I see the code which generates output for this option (GenerateClassFromObject) but it is invoked 0 times.
~/protobuf$ grep -r GenerateClassFromObject .
./src/google/protobuf/compiler/js/js_generator.cc:void Generator::GenerateClassFromObject(const GeneratorOptions& options,
./src/google/protobuf/compiler/js/js_generator.h: void GenerateClassFromObject(const GeneratorOptions& options,
Can the jspb.generate_from_object option be open sourced?
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start by reading src/google/protobuf/compiler/js/js_generator.cc and js_generator.h, especially GenerateClassFromObject and the generator option handling. Determine how jspb.generate_from_object should activate the existing generation path; done means the option is recognized and produces the expected fromObject methods for generated JavaScript.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100