protocolbuffers / protocolbuffers/protobuf-javascript

js/{closure,commonjs}: create a new js_module option

Open
#65 18 comments 28 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted javascript triaged
Dominant language
JavaScript
Stars
471
Forks
91
Avg merge
3h 57m
Merged PRs (30d)
2

Description

What language does this apply to?

If it's a proto syntax change, is it for proto2 or proto3? proto3
If it's about generated code change, what programming language? javascript/commonjs but it can be applied to es6 or closure as well.

Describe the problem you are trying to solve.

We are generating code of multiple packages that we want to publish independently but with references between them. Currently the generator creates a tightly coupled relative paths between folders.

Describe the solution you'd like

An option like Go's go_package or C#'s csharp_namespace where I can put the import path, in this case the JS module.

I think a js_module called option would do the trick.

Describe alternatives you've considered

Overriding the generated code.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the JavaScript generator's handling of relative imports for CommonJS, ES6, and Closure output, then review the discussion on this issue for the proposed js_module semantics. Done means an option can set independent module import paths while preserving references between generated packages across the supported JavaScript targets.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.