Skip to content

Conversation

@ChadKillingsworth
Copy link
Collaborator

@ChadKillingsworth ChadKillingsworth commented Nov 5, 2016

Adds a --module_resolution flag to allow users to opt-out of loading from node_modules registries. However the path-based algorithm still follows the node module loading spec with regard to file extension priority and utilizing package.json file main enteries for directories.

Adds JSON file support if any module processing is enabled.

Note that the JSParser attempts to resolve ES6 module paths and issue loading errors. This seems strange because similar functionality exists in the ProcessEs6Modules pass (which seems more appropriate). I'm not sure why this logic exists in the parser, but I didn't want to move that until I understood the implications.

Fixes #1897 - any file extension is now allowed for either CommonJS or ES6 modules

UPDATE - Final Options
There are now 3 resolution modes - all of which effect both CommonJS and ES6 modules:

  • LEGACY keeps the same behavior the compiler has used historically.
    • Modules which do not begin with a "." or "/" character are assumed to be relative to the compilation root.
    • Modules files can only have ".js" file extensions. The extension is auto-added if the import omits them.
  • NODE uses the node module resolution algorithm
    • Modules which do not begin with a "." or "/" character are looked up from the appropriate node_modules folder. Includes the ability to require directories and JSON files.
    • Files may be any extension. The compiler searches for an exact match, then ".js", then ".json".
  • BROWSER mimics the behavior of MS Edge
    • Modules must begin with a "." or "/" character
    • Modules import statements must include the file extension

@brad4d brad4d self-assigned this Nov 7, 2016
@brad4d
Copy link
Contributor

brad4d commented Nov 10, 2016

Sorry for the delay.
I'm importing and reviewing this now.

@ChadKillingsworth
Copy link
Collaborator Author

After mulling this over a bit, I think it might be better to restrict the PATH_ONLY mode to loading files only and exclude the directory loading logic. I don't think directory loading logic will every be supported by browsers.

@brad4d
Copy link
Contributor

brad4d commented Nov 10, 2016

@ChadKillingsworth will that be a significant change to what you have so far?
I've been making changes to my internal copy to get tests to pass. Should I just wait for your update?

@ChadKillingsworth
Copy link
Collaborator Author

It should not be a significant update.

Github has this new feature though - you can push any changes you make back to git@github.com:ChadKillingsworth/closure-compiler.git -> node-modules-es6 branch. I can add my changes on top of that.

@brad4d
Copy link
Contributor

brad4d commented Nov 10, 2016

That's good to know. Thanks.
However I don't know right off how to easily get my changes back into git,
so don't wait for me.
I'll keep trying to find out though.

On Thu, Nov 10, 2016 at 11:06 AM Chad Killingsworth <
notifications@github.com> wrote:

It should not be a significant update.

Github has this new feature though - you can push any changes you make
back to git@github.com:ChadKillingsworth/closure-compiler.git ->
node-modules-es6 branch. I can add my changes on top of that.


You are receiving this because you were assigned.

Reply to this email directly, view it on GitHub
#2130 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABEEY6WfyaldU9ZCqWElCt5QeAcJ92T2ks5q82tNgaJpZM4KqYvI
.

@ChadKillingsworth
Copy link
Collaborator Author

ChadKillingsworth commented Nov 11, 2016

I pushed up a separate commit with the changes.

A lot of the tests had modules without a path identifier (didn't start with a . or / character). This definitely didn't work in external code (see #2139), but I'm unsure of the impact of this at Google. Edge is the only browser that supports ES6 modules currently. Edge not only requires import strings to begin with a . or / character, but also requires a file extension. However the specs seem pretty silent on this front.

We should probably discuss the impact of module path changes at the meeting on Monday.

@brad4d
Copy link
Contributor

brad4d commented Nov 14, 2016

@ChadKillingsworth could you go ahead and squash this into one commit?
Our import tool chokes otherwise, and it isn't clear how to work around it.
I'll just need to re-apply my previous changes on a new import.

@ChadKillingsworth
Copy link
Collaborator Author

@brad4d done

@brad4d
Copy link
Contributor

brad4d commented Nov 14, 2016

Thanks, re-importing and testing now.

@brad4d
Copy link
Contributor

brad4d commented Nov 15, 2016

The runtime_tests/module_tests are failing with this imported.
I'm now running mvn in my git repo including this change to see if it fails there, too.

@brad4d
Copy link
Contributor

brad4d commented Nov 15, 2016

No failures from running mvn, but I'm not sure it's actually running the tests in runtime_tests.

@ChadKillingsworth
Copy link
Collaborator Author

How can I run the runtime_tests? I always just use the mvn test command.

@brad4d
Copy link
Contributor

brad4d commented Nov 15, 2016

@ChadKillingsworth
That is an excellent question.
It seems that we haven't developed any way for external folks to conveniently run these, which is obviously a problem. I'll file an issue for that.

In the meantime the problem is occurring with absolute_path_test.js.
The failure I'm seeing right now happens at compile time using these options.
I've modified them so I think they will work if you have closure-library checked out as a sibling directory to closure-compiler.

--jscomp_off=checkTypes
--jscomp_off=undefinedVars
--export_test_functions=true
--language_in=ECMASCRIPT6_STRICT
--language_out=ES3
--property_renaming=OFF
--strict
--variable_renaming=OFF
--jscomp_error=accessControls
--jscomp_error=ambiguousFunctionDecl
--jscomp_error=checkDebuggerStatement
--jscomp_error=checkEventfulObjectDisposal
--jscomp_error=checkRegExp
--jscomp_error=checkTypes
--jscomp_error=checkVars
--jscomp_error=const
--jscomp_error=constantProperty
--jscomp_error=deprecated
--jscomp_error=duplicate
--jscomp_error=duplicateMessage
--jscomp_error=externsValidation
--jscomp_error=extraRequire
--jscomp_error=fileoverviewTags
--jscomp_error=globalThis
--jscomp_error=internetExplorerChecks
--jscomp_error=invalidCasts
--jscomp_error=missingProperties
--jscomp_error=missingRequire
--jscomp_error=nonStandardJsDocs
--jscomp_error=strictModuleDepCheck
--jscomp_error=undefinedNames
--jscomp_error=undefinedVars
--jscomp_error=unknownDefines
--jscomp_error=uselessCode
--jscomp_error=visibility
--collapse_properties
--export_test_functions
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/classProtectedMethod.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/decl_leg_name_a.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/exportClass.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/exportDefault.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/exportDefaultClass.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/exportDefaultOldStyleClass.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/exportFrom.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/exportSpec.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/fq_jsdoc_a.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/goog_module.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/importAndExport.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/moduleOrderA.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/moduleOrderB.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/moduleOrderC.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/moduleOrderRecorder.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/module_destructuring.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/module_es3_a.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/module_es6_a.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/namespace_export.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/nesting.Outer.Inner.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/nesting.Outer.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/referenceOtherModule.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/simpleExport.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/typedef.js
--js ../closure-library/closure/goog/base.js
--js ../closure-library/closure/goog/deps.js
--js ../closure-library/closure/goog/testing/stacktrace.js
--js ../closure-library/closure/goog/testing/asserts.js
--js ../closure-library/closure/goog/debug/error.js
--js ../closure-library/closure/goog/dom/nodetype.js
--js ../closure-library/closure/goog/string/string.js
--js ../closure-library/closure/goog/asserts/asserts.js
--js ../closure-library/closure/goog/array/array.js
--js ../closure-library/closure/goog/dom/tagname.js
--js ../closure-library/closure/goog/object/object.js
--js ../closure-library/closure/goog/dom/tags.js
--js ../closure-library/closure/goog/i18n/bidi.js
--js ../closure-library/closure/goog/labs/useragent/util.js
--js ../closure-library/closure/goog/labs/useragent/browser.js
--js ../closure-library/closure/goog/string/typedstring.js
--js ../closure-library/closure/goog/string/const.js
--js ../closure-library/closure/goog/html/safestyle.js
--js ../closure-library/closure/goog/html/safestylesheet.js
--js ../closure-library/closure/goog/fs/url.js
--js ../closure-library/closure/goog/html/safeurl.js
--js ../closure-library/closure/goog/html/trustedresourceurl.js
--js ../closure-library/closure/goog/html/safehtml.js
--js ../closure-library/closure/goog/html/safescript.js
--js ../closure-library/closure/goog/html/uncheckedconversions.js
--js ../closure-library/closure/goog/structs/collection.js
--js ../closure-library/closure/goog/functions/functions.js
--js ../closure-library/closure/goog/math/math.js
--js ../closure-library/closure/goog/iter/iter.js
--js ../closure-library/closure/goog/structs/map.js
--js ../closure-library/closure/goog/structs/structs.js
--js ../closure-library/closure/goog/structs/set.js
--js ../closure-library/closure/goog/labs/useragent/engine.js
--js ../closure-library/closure/goog/labs/useragent/platform.js
--js ../closure-library/closure/goog/reflect/reflect.js
--js ../closure-library/closure/goog/useragent/useragent.js
--js ../closure-library/closure/goog/debug/debug.js
--js ../closure-library/closure/goog/debug/logrecord.js
--js ../closure-library/closure/goog/debug/logbuffer.js
--js ../closure-library/closure/goog/debug/logger.js
--js ../closure-library/closure/goog/debug/relativetimeprovider.js
--js ../closure-library/closure/goog/debug/formatter.js
--js ../closure-library/closure/goog/debug/console.js
--js ../closure-library/closure/goog/math/coordinate.js
--js ../closure-library/closure/goog/math/size.js
--js ../closure-library/closure/goog/dom/browserfeature.js
--js ../closure-library/closure/goog/dom/safe.js
--js ../closure-library/closure/goog/dom/dom.js
--js ../closure-library/closure/goog/async/freelist.js
--js ../closure-library/closure/goog/debug/entrypointregistry.js
--js ../closure-library/closure/goog/async/nexttick.js
--js ../closure-library/closure/goog/async/workqueue.js
--js ../closure-library/closure/goog/async/run.js
--js ../closure-library/closure/goog/promise/resolver.js
--js ../closure-library/closure/goog/promise/thenable.js
--js ../closure-library/closure/goog/promise/promise.js
--js ../closure-library/closure/goog/testing/testcase.js
--js ../closure-library/closure/goog/testing/testrunner.js
--js ../closure-library/closure/goog/testing/jsunit.js
--js ../closure-library/closure/goog/disposable/idisposable.js
--js ../closure-library/closure/goog/disposable/disposable.js
--js ../closure-library/closure/goog/events/browserfeature.js
--js ../closure-library/closure/goog/events/eventid.js
--js ../closure-library/closure/goog/events/event.js
--js ../closure-library/closure/goog/events/eventtype.js
--js ../closure-library/closure/goog/events/browserevent.js
--js ../closure-library/closure/goog/events/listenable.js
--js ../closure-library/closure/goog/events/listener.js
--js ../closure-library/closure/goog/events/listenermap.js
--js ../closure-library/closure/goog/events/events.js
--js ../closure-library/closure/goog/events/eventtarget.js
--js ../closure-library/closure/goog/events/keycodes.js
--js ../closure-library/closure/goog/dom/vendor.js
--js ../closure-library/closure/goog/html/legacyconversions.js
--js ../closure-library/closure/goog/math/box.js
--js ../closure-library/closure/goog/math/irect.js
--js ../closure-library/closure/goog/math/rect.js
--js ../closure-library/closure/goog/style/style.js
--js ../closure-library/closure/goog/testing/events/events.js
--js ../closure-library/closure/goog/testing/objectpropertystring.js
--js ../closure-library/closure/goog/testing/propertyreplacer.js
--js ../closure-library/closure/goog/testing/mockclock.js
--js ../closure-library/closure/goog/testing/mockinterface.js
--js ../closure-library/closure/goog/testing/mockmatchers.js
--js ../closure-library/closure/goog/testing/mock.js
--js ../closure-library/closure/goog/testing/loosemock.js
--js ../closure-library/closure/goog/testing/strictmock.js
--js ../closure-library/closure/goog/testing/functionmock.js
--js ../closure-library/closure/goog/testing/mockcontrol.js
--js ../closure-library/closure/goog/labs/testing/environment.js
--js ../closure-library/closure/goog/testing/testsuite.js
--js ../closure-library/closure/goog/events/eventhandler.js
--js test/com/google/javascript/jscomp/runtime_tests/module_tests/absolute_path_test.js
--externs externs/google.js
--externs externs/es3.js
--externs externs/es5.js
--externs externs/es6.js
--externs externs/es6_collections.js
--externs externs/w3c_event.js
--externs externs/w3c_event3.js
--externs externs/w3c_device_sensor_event.js
--externs externs/gecko_event.js
--externs externs/ie_event.js
--externs externs/webkit_event.js
--externs externs/w3c_pointer_events.js
--externs externs/w3c_gamepad.js
--externs externs/w3c_dom1.js
--externs externs/w3c_dom2.js
--externs externs/w3c_dom3.js
--externs externs/w3c_dom4.js
--externs externs/html5.js
--externs externs/gecko_dom.js
--externs externs/ie_dom.js
--externs externs/webkit_dom.js
--externs externs/w3c_css.js
--externs externs/gecko_css.js
--externs externs/ie_css.js
--externs externs/webkit_css.js
--externs externs/chrome.js
--externs externs/deprecated.js
--externs externs/fileapi.js
--externs externs/flash.js
--externs externs/gecko_xml.js
--externs externs/page_visibility.js
--externs externs/ie_vml.js
--externs externs/intersection_observer.js
--externs externs/iphone.js
--externs externs/mediakeys.js
--externs externs/mediasource.js
--externs externs/url.js
--externs externs/v8.js
--externs externs/webstorage.js
--externs externs/whatwg_encoding.js
--externs externs/w3c_anim_timing.js
--externs externs/w3c_audio.js
--externs externs/w3c_batterystatus.js
--externs externs/w3c_clipboardevent.js
--externs externs/w3c_css3d.js
--externs externs/w3c_elementtraversal.js
--externs externs/w3c_eventsource.js
--externs externs/w3c_geolocation.js
--externs externs/w3c_indexeddb.js
--externs externs/w3c_midi.js
--externs externs/w3c_navigation_timing.js
--externs externs/w3c_range.js
--externs externs/w3c_rtc.js
--externs externs/w3c_screen_orientation.js
--externs externs/w3c_selectors.js
--externs externs/w3c_speech.js
--externs externs/w3c_touch_event.js
--externs externs/w3c_webcrypto.js
--externs externs/w3c_xml.js
--externs externs/window.js
--externs externs/webkit_notifications.js
--externs externs/webkit_usercontent.js
--externs externs/webgl.js
--externs externs/w3c_serviceworker.js
--externs externs/w3c_permissions.js
--externs externs/intl.js
--externs externs/fetchapi.js
--externs externs/streamsapi.js

@brad4d
Copy link
Contributor

brad4d commented Nov 15, 2016

Or not... Still some Google-specific command line options there...

@ChadKillingsworth
Copy link
Collaborator Author

I noticed. Trying to create a custom build with those options.

@ChadKillingsworth
Copy link
Collaborator Author

@brad4d I've gotten some of the tests to compile and run - not even close to all the requirements are available externally. Can you list which test files have failures? I'll restrict my work to looking just at those.

@brad4d
Copy link
Contributor

brad4d commented Nov 15, 2016

My test run bailed after the file I already mentioned above.
I'm running again with an option to make it keep going for other files.
Stay tuned.

@ChadKillingsworth
Copy link
Collaborator Author

@brad4d That test isn't in the open source repo:
test/com/google/javascript/jscomp/runtime_tests/module_tests/absolute_path_test.js

If you can send it to me via email, I'll see what's going on.

@brad4d
Copy link
Contributor

brad4d commented Nov 16, 2016

Well, that's interesting. absolute_path_test.js is explicitly excluded.

@MatrixFrog
Copy link
Contributor

Right because the absolute path is different within Google than it is here. Until external people can run the tests, I don't think it's worth it to make an external version of that test.

@brad4d
Copy link
Contributor

brad4d commented Nov 16, 2016

OK, well it's only excluded because it contains a hard-coded path that won't work in the git repo.
It's tiny, so here's its full text with the full path modified to match the git repo.

import s from 'test/com/google/javascript/jscomp/runtime_tests/module_tests/module_test_resources/exportDefault';

function testDefault() {
  assertEquals('this is the default export', s);
}

@ChadKillingsworth
Copy link
Collaborator Author

So I can see right away the problem: the path doesn't start with either a '.' or '/'. This is by design. We can change that behavior for PATH_ONLY, but it seems like this is a case we should fix. However if it's a big fix, we can do it in stages.

Is there by chance a --js_module_root flag used on that test?

@MatrixFrog
Copy link
Contributor

I think internally Blaze automatically passes a default --js_module_root flag, yes.

@ChadKillingsworth
Copy link
Collaborator Author

How do we want to normalize this then? Outside of Google other module loaders let you specify roots, but still require the '/' or '.' character preceding.

@brad4d
Copy link
Contributor

brad4d commented Jan 9, 2017

@ChadKillingsworth
Just before I left for vacation I added DepsGeneratorTest.java to the repo.
This should be the place to put a test that reproduces the internal test failure.

@brad4d
Copy link
Contributor

brad4d commented Jan 9, 2017

I think I'm now seeing some other test failures likely due to the repo moving forward.
I'm going to do a fresh import of this PR to work from...

@brad4d
Copy link
Contributor

brad4d commented Jan 11, 2017

@ChadKillingsworth I think you made a small change that seems to have fixed the problem test in the latest import I did. Yay!
The other failures turned out to be just things I needed to tweak or timeouts.
I'm doing a "test all the things" run, but I'm feeling pretty optimistic about getting this submitted now.

@brad4d
Copy link
Contributor

brad4d commented Jan 12, 2017

The only failing tests now are 2 belonging to @jart in closure rules.

Errors look like this:

HINT: Closure will compile faster if you run: echo "build --strategy=Closure=worker" >>~/.bazelrc
third_party/bazel_rules/rules_closure/closure/testing/test/arithmetic_es6module_test.js:18: ERROR - Failed to load module "third_party/bazel_rules/rules_closure/closure/testing/test/arithmetic_es6module"
import { add } from 'third_party/bazel_rules/rules_closure/closure/testing/test/arithmetic_es6module';
^
  ProTip: "JSC_JS_MODULE_LOAD_WARNING" can be added to the `suppress` attribute of:
  //third_party/bazel_rules/rules_closure/closure/testing/test:arithmetic_es6module_test_lib

loadAddress = resolveCommonJsModuleFromRegistry(requireName);
switch (resolutionMode) {
case LEGACY:
loadAddress = resolveJsModuleFile(moduleAddress);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChadKillingsworth, I'd expect LEGACY to preserve the behavior as it was prior to this change, but this is not.
I think I should change this to contain something like the if/else statement above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LEGACY mode should never resolve a directory. I thought this code path was identical to the old behavior, but it's possible that it's a change. Is there a specific case that this is breaking?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChadKillingsworth
The only breakages I know of are the 2 related to closure rules I mentioned above.
I'm not sure of exactly why they fail,
but the LEGACY code path is definitely not defining the same behavior as before this PR,
so I believe the answer lies somewhere in that difference.

Since you said you updated it, I'll grab a fresh copy of this PR.
I'm going to modify it a bit before submission to ensure that the LEGACY code path preserves current behavior.

Copy link
Collaborator Author

@ChadKillingsworth ChadKillingsworth Jan 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brad4d So I missed the last set of comments about the closure-rules. Github page caching just didn't even show them to me. I think one minor tweak ought to fix the Closure-rules issue. It's nice to see this getting close.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can even add a test for that case ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shiny!
I'd really like to see the PR show a clear preservation of the previous behavior for the LEGACY code path, though, rather than just a fix for this one case.

Could you do something like this?

  1. Define private ModuleLoader.legacyResolveJsModule() (& related methods) that completely preserves current behavior in a way that is clear in the diff.
  2. Call that from the LEGACY case in the switch statement.

Thanks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's no problem at all. I'll do it this weekend.

Adds a --module_resolution flag to specify whether to use the legacy, node or browser module resolution algortithm to locate modules.
@ChadKillingsworth
Copy link
Collaborator Author

@brad4d Changes made.

The legacy function always returns a module path - even if it doesn't exist. This is how the current functionality works. Both of the other modes return null in this case.

if (isAbsoluteIdentifier(requireName) || isRelativeIdentifier(requireName)) {
loadAddress = resolveCommonJsModuleFileOrDirectory(requireName);
} else {
loadAddress = resolveCommonJsModuleFromRegistry(requireName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChadKillingsworth
I expected to see this if-else in resolveJsModuleLegacy(), probably calling different subroutines, though (e.g. resolveLegacyJsModuleFileOrDirectory())

I believe you are trying to simplify things by eliminating cases that shouldn't apply in LEGACY mode,
but this still makes the change more risky.
I'd rather such simplification be done in a separate change.

@brad4d
Copy link
Contributor

brad4d commented Jan 25, 2017

Latest version imported & essential internal tweaks applied.
I've resolved the conflict github noticed in CommandLineRunner.java in my internal copy.
Internal testing in progress.

@brad4d
Copy link
Contributor

brad4d commented Jan 27, 2017

This has been submitted internally & will appear in github on our daily export.

@probins
Copy link

probins commented Jan 28, 2017

@ChadKillingsworth I see you've updated the JS Modules wiki page. Node and Browser resolution mode both say 'This is the only mode available for releases after Feb 2017`. I assume that this should read 'This mode is only available for releases after Dec 2016' (or possibly 'from Feb 2017', assuming there'll be a release containing this change in Feb)?

@ChadKillingsworth
Copy link
Collaborator Author

@probins You should simply read that as the code has yet to be released. Utilizing the behavior requires building the compiler from HEAD. I'll be updating the page again one a release containing the code has occurred.

This PR has such a high level of interest, I wanted the documentation out there for people to use it.

@supersteves
Copy link
Contributor

I think @probins main point was that I think you copy pasted wrong.
"This is the only mode available for releases after Feb 2017"
should be
"This mode is only available for releases after Feb 2017"
for the 2 new modes.

@ChadKillingsworth
Copy link
Collaborator Author

Ahh good catch - fixed.

ChadKillingsworth added a commit to ChadKillingsworth/closure-compiler that referenced this pull request Feb 3, 2017
Adds a --module_resolution flag to specify whether to use the legacy,
node, or browser module resolution algorithm to locate modules.

Closes google#2130

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145837856
alexeykomov pushed a commit to alexeykomov/closure-compiler that referenced this pull request Feb 8, 2017
Just fail if the file doesn't exist.
This check was preventing use of SourceFile.fromCode().

Related to google#2130

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=141941923
alexeykomov pushed a commit to alexeykomov/closure-compiler that referenced this pull request Feb 8, 2017
Related to google#2130

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142472421
alexeykomov pushed a commit to alexeykomov/closure-compiler that referenced this pull request Feb 8, 2017
Adds a --module_resolution flag to specify whether to use the legacy,
node, or browser module resolution algorithm to locate modules.

Closes google#2130

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145837856
@jart
Copy link
Contributor

jart commented Feb 15, 2018

Note for anyone reading in the future, TensorBoard learned the hard way that ES6 modules are grimly fiendish. tensorflow/tensorboard#747

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ES6 imports of paths with '.js' extension does not work

9 participants