Permalink
Browse files

Annotate namespaces generated by static target, see #550

  • Loading branch information...
dcodeIO committed Dec 13, 2016
1 parent d31590b commit e3e77d0c7dc973d3a5948a49d123bdaf8a048030
Showing with 7 additions and 1 deletion.
  1. +2 −0 README.md
  2. +5 −1 cli/targets/static.js
@@ -342,6 +342,8 @@ While .proto and JSON files require the full library (about 20kb gzipped), prett
Static code, on the other hand, requires just the runtime library (final size TBA), but generates relatively large code bases without any reflection features.
There is no difference performance-wise as the code that is generated statically is the same generated at runtime.
### Generating TypeScript definitions from static modules
Likewise, the `pbts` command line utility can be used to generate TypeScript definitions from `pbjs`-generated static modules.
@@ -93,7 +93,11 @@ function buildNamespace(ref, ns) {
buildService(undefined, ns);
else if (ns.name !== "") {
push("");
push("/** @alias " + (ns.name && ns.fullName.substring(1) || "exports") + " */");
pushComment([
"Namespace " + ns.name + ".",
"@exports " + ns.fullName.substring(1),
"@namespace"
]);
push("var " + name(ns.name) + " = {};");
}

0 comments on commit e3e77d0

Please sign in to comment.