mafintosh / mafintosh/protocol-buffers

"Offline" interface precompilation

Open
#19 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
760
Forks
75
PR merge metrics
No merged PRs in 30d

Description

Here's another thought, related to #18. For a library like [multiplex](https://github.com/maxogden/multiplex) and probably many other cases, why not let them eliminate the "schema compilation" step at that level entirely?

What I mean is this use case:

Say someone wants to use 'multiplex', they simply `npm install multiplex` and use its API. (They maybe don't even care that it uses protocol buffers "under the hood", they're just happy that things seem to be fast/efficient.) Why should they end up needing to install 'generate-function' and similar packages, and re-parsing the schema files every time their script starts?

Ideally, a library like 'multiplex' could instead use `devDependencies` and a `prepublish` script to pre-compile the schemas, and then all the published package itself would require, just a file containing the pre-generated code! (The Handlebars template engine offers [a pre-compilation option](https://github.com/wycats/handlebars.js/blob/62ed555b2c8d9e0fd37a1384dadfaeb3a7a94e61/README.markdown#precompiling-templates) kinda like this, for example.)

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

No source files or tests are named. Start by reviewing related issue #18 and the package's npm publishing flow, including the proposed devDependencies and prepublish approach. Done means consumers can install the published package and use generated schema code without installing generation tools or recompiling schemas at startup.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
build-system
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.