Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Roll forward of Rework interop between closure files and ES6 modules.
- Fix goog.require and goog: import in ES6 modules for non-legacy goog.modules. - Add support for a new path based goog.require to require ES6 modules from goog modules. - ES6 modules can call "goog.module.declareNamespace('namespace')" to declare a non-legacy goog.module-like namespace. This is for backwards compatibility so users can update their goog.modules to ES6 modules in place. Note this migration path doesn't work for default exports (there is no analogy for "exports = x" in ES6 modules) or for legacy modules (goog.module.declareNamespace does not declare a legacy namespace and we won't add support for it). Library and deps generation support for this will be added in a future change. NEW: Whitelist polymer for the new mixed module type error. Polymer is generating files with goog.provide and es6 imports because there is no good interop story yet. These files are 100% side effect based, thus nothing should ever reference them, and rewriting doesn't matter. Automated g4 rollback of changelist 191366556. *** Reason for rollback *** Roll forward, whitelisting polymer. *** Original change description *** Automated g4 rollback of changelist 191347644. *** Reason for rollback *** Tap failures (polymer emits mixed modules). *** Original change description *** Rework interop between closure files and ES6 modules. - Fix goog.require and goog: import in ES6 modules for non-legacy goog.modules. - Add support for a new path based goog.require to require ES6 modules from goog modules. - ES6 modules can call "goog.module.declareNamespace('namespace')" to declare a non-legacy goog.module-like namespac... *** Public: Rework interop between closure files and ES6 modules. - Fix goog.require and goog: import in ES6 modules for non-legacy goog.modules. - Add support for a new path based goog.require to require ES6 modules from goog modules. - ES6 modules can call "goog.module.declareNamespace('namespace')" to declare a non-legacy goog.module-like namespace. This is for backwards compatibility so users can update their goog.modules to ES6 modules in place. Note this migration path doesn't work for default exports (there is no analogy for "exports = x" in ES6 modules) or for legacy modules (goog.module.declareNamespace does not declare a legacy namespace and we won't add support for it). Library and deps generation support for this will be added in a future change. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=191905296
- Loading branch information