google / google/closure-compiler
Support Module Rewriting on Externs
Open
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
It's been the norm for CommonJS for a long time and now with ES6 it will be even more prevalent. I think the ES6 and CommonJS module rewriting should be done on externs. This should pave the way to support non-global extern types.
Note: this would be a breaking change for the Node externs as they have export statements which would actually trigger the rewriting.
The final goal for this is to be able to have non-global typed externs and to be able to use those types in code:
``` js
var externalRequire = require;
/** @type {externs.zip//nodejs/http/http} http */
var http = externalRequire("http");
```
Contributor guide
Assessment
This issue has not been assessed yet.