Skip to content

Commit e3e77d0

Browse files
committed
Annotate namespaces generated by static target, see #550
1 parent d31590b commit e3e77d0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ While .proto and JSON files require the full library (about 20kb gzipped), prett
342342

343343
Static code, on the other hand, requires just the runtime library (final size TBA), but generates relatively large code bases without any reflection features.
344344

345+
There is no difference performance-wise as the code that is generated statically is the same generated at runtime.
346+
345347
### Generating TypeScript definitions from static modules
346348

347349
Likewise, the `pbts` command line utility can be used to generate TypeScript definitions from `pbjs`-generated static modules.

cli/targets/static.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ function buildNamespace(ref, ns) {
9393
buildService(undefined, ns);
9494
else if (ns.name !== "") {
9595
push("");
96-
push("/** @alias " + (ns.name && ns.fullName.substring(1) || "exports") + " */");
96+
pushComment([
97+
"Namespace " + ns.name + ".",
98+
"@exports " + ns.fullName.substring(1),
99+
"@namespace"
100+
]);
97101
push("var " + name(ns.name) + " = {};");
98102
}
99103

0 commit comments

Comments
 (0)