Re: [chromium-dev] ES6 in Chromium proposal: Allow modules

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: [chromium-dev] ES6 in Chromium proposal: Allow modules

kai zhu
adding people from [hidden email] into the loop, to give us insight on the state of es6-module adoption.


On 26 May 2018, at 3:52 AM, Jimmy Hastings <[hidden email]> wrote:

(Changing subject per dpapad's suggestion)

Does anyone have an iOS device they can test on?  This seems like a knowable problem, even though none of the compatibility tables I found list Chrome on iOS.

Should it be found not to work, any objection to saying it's allowed in desktop-only code?

On Fri, May 25, 2018 at 9:49 AM PhistucK <[hidden email]> wrote:
Unfortunately, even WKWebKit does not fully support everything that Safari supports (well, this is plaguing Android Web View as well), so always make sure it works in WKWebKit, even if it works in Safari.

PhistucK


On Fri, May 25, 2018 at 7:44 PM Sylvain Defresne <[hidden email]> wrote:
Chrome on iOS uses WKWebView to render html/javascript, not v8. So basically if uses what Safari does support on iOS, not what v8 supports.
-- Sylvain

On Fri, May 25, 2018 at 6:36 PM <[hidden email]> wrote:
Style guide deviation: It seems like an acceptable deviation because we don't have to deal with cross-browser compatibility, so only we only need to worry about Chrome's semantics, which have been implemented for 7 versions now.  Furthermore, Closure library is basically a built-in with normal google code, so there's no reason for it there.
Related toolchain: I'm not super familiar with all the tools, so I don't know if it breaks any related toolchains.  I know that It compiles and runs fine in the way I did it, and it works with es style presubmits with the .eslintrc.
Platforms: It's a feature of the browser and v8, not the OS?  I'm not sure why it wouldn't be supported on iOS.  I might be missing something.

On Friday, May 25, 2018 at 1:35:19 AM UTC-7, Mike Frysinger wrote:
https://chromium.googlesource.com/chromium/src/+/master/styleguide/web/web.md#JavaScript
> Style
> See the Google JavaScript Style Guide.

a proposal to deviate from the agreed upon style guide should clearly explain why the deviation is acceptable.
-mike

On Fri, May 25, 2018 at 4:29 PM Michael Giuffrida <[hidden email]> wrote:
I'm not too concerned with the Google style guide's take on ES6 modules because Google practically treats the Closure library like a built-in, so they don't need modules due to universal goog.module and goog.require statements.

On Fri, May 25, 2018 at 1:21 AM Mike Frysinger <[hidden email]> wrote:

On Fri, May 25, 2018 at 8:57 AM dpapad <[hidden email]> wrote:
The title of this thread is probably a bit too generic. See previous ES6 styleguide proposal threads as examples for template literals, arrow functions, new static methods, default parameters.
The main issues to figure out when proposing a new ES6 feature are
  • Does any part of our related toolchain breaks as a result of it (for example closure compiler, uglify, crisper, polymer-bundler, eslint, clang-format, PRESUBMIT checks)?
  • Which platforms that Chromium runs support that feature (does iOS for example support it)? If not there needs to be a note in the styleguide (sometimes even a PRESUBMIT check), to prevent such usage.
Overall, I think using ES6 modules is positive, so personally I support it, but we need to figure out whether anything breaks by doing so.

Hope this helps,
Thank you,
Demetrios

On Thursday, May 24, 2018 at 5:22:49 PM UTC-7, Jimmy Hastings wrote:
https://chromium.googlesource.com/chromium/src.git/+/HEAD/docs/es6_chromium.md#modules

They've been supported in Chrome since M61.  Seems like an elegant way to organize code if you're in an environment where you can make it work (Not having non-module code that needs to depend on you).  I made it work for a self-contained component extension.  A module author would need to add
  "parserOptions": {
    "sourceType": "module",
  },
to an .eslintrc to make the presubmits happy.  js2g tests can be shoehorned to work with it by having it import an html file that contains something like
<script type="module">
  import * as devtools from './devtools.js';
  window.devtools = devtools;
</script>
That seems like the least work infrastructure-wise, but if desired it could be made more elegant.

Discuss!

-Jimmy

--
--
Chromium Developers mailing list: [hidden email]
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/d30ac84f-62e9-4450-810b-aed64516609d%40chromium.org.

--
--
Chromium Developers mailing list: [hidden email]
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/faf84f7b-ba11-4959-aebe-7b2d3c4ca668%40chromium.org.

--
--
Chromium Developers mailing list: [hidden email]
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAEhBV%3Duhyz%3DmZ1-QOzFRn6AVZCDgK2zSwvUUT-qCW-5-XQ9xiA%40mail.gmail.com.

--
--
Chromium Developers mailing list: [hidden email]
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CALzLt2WBzQumd%2Bpy51Bx%3DUiALE%2B3_Z_GBejLVJg_t4TA%2BTqu2g%40mail.gmail.com.


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss