js: protocols bundled with package are incompatible with commonjs_strict
Dieses Issue hat noch niemand übernommen.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
This issue is about google-protobuf@3.12.4 js package, as published on npm.
Currently, it contains the following files:
./README.md
./google-protobuf.js
./package.json
./google/protobuf/any_pb.js
./google/protobuf/empty_pb.js
./google/protobuf/descriptor_pb.js
./google/protobuf/field_mask_pb.js
./google/protobuf/type_pb.js
./google/protobuf/duration_pb.js
./google/protobuf/source_context_pb.js
./google/protobuf/struct_pb.js
./google/protobuf/api_pb.js
./google/protobuf/compiler/plugin_pb.js
./google/protobuf/timestamp_pb.js
./google/protobuf/wrappers_pb.js
./google/ protocols are built in commonjs mode as opposed to commonjs_strict, which makes them both pollute the global scope (they create a global proto variable) and not compatible with CSP (they use Function constructor):
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
goog.exportSymbol('proto.google.protobuf.Any', null, global);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.google.protobuf.Any = function(opt_data) {
I would have expected commonjs_strict protocols to be present there, either under the same folder, or perhaps in a separate google/protobuf.strict or strict/google/protobuf directory.
That would make them usable in commonjs_strict mode.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 471
- Forks
- 91
- Ø Merge
- 3 Std. 57 Min.
- Gemergte PRs (30 T.)
- 2
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus protocolbuffers/protobuf-javascript
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 30/100
protocolbuffers/protobuf-javascript#248 · 1 Kommentar · 13 Reaktionen ·
-
question
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
protocolbuffers/protobuf-javascript#222 · 9 Kommentare ·
-
Why map.js sort keys? Offenenhancement port-fix triaged
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
protocolbuffers/protobuf-javascript#185 · 1 Kommentar ·
-
enhancement port-fix triaged
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
protocolbuffers/protobuf-javascript#182 · 3 Kommentare · 1 Reaktion ·
Alle Issues in protocolbuffers/protobuf-javascript
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
-
area-deployment area-integrations triage:bot-seen
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 86/100
-
Issue-Bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
sugarlabs/musicblocks#8924 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
ArduPilot/ardupilot_wiki#8088 ·
-
[BUG] createTool tools cannot be registered with Mastra when exactOptionalPropertyTypes is enabled Offencustomer-eng status: needs triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100