r/javascript • • May 17 '16

WebKit is now 100% ES6 complete

https://twitter.com/webkit/status/728643624464883712
382 Upvotes

35 comments sorted by

28

u/[deleted] May 17 '16

Are modules not considered part of ES6 now then? None of the vendors have finished implementing them yet, so I'm not sure if this 100% figure holds up.

3

u/lhorie May 17 '16

I'm not sure if this 100% figure holds up

It technically does: https://bugs.webkit.org/show_bug.cgi?id=147340

OK, now, ES6 Modules in JSC shell is landed! It's time to integrate it to WebCore! (first, we'll enable it only inside WebKit, not expose it to user space, because the loader spec is not mature yet.)

They implemented modules, but they aren't exposed because as u/OptimisticLockExcept said, the loader spec is not part of ES6 (and not finalized yet, iirc).

23

u/OptimisticLockExcept May 17 '16 edited May 18 '16

Modules are part of es2015 (es6). But the loader spec is not part of es2015. So in theory to be 100% es2015 compliant you have to implement modules. But they would be useless since you could not "start" a module nor could you import anything from an other module.

2

u/jineshshah36 May 17 '16

How does this: https://blogs.windows.com/msedgedev/2016/05/17/es6-modules-and-beyond/ fall into the mix? Isn't this an implementation of the loader spec?

3

u/OptimisticLockExcept May 18 '16 edited May 18 '16

I'd guess that they implemented the unfinished loader spec. But the specification is still changing. So you probably can't rely on this implementation in edge.

Edit: I think this is the spec http://whatwg.github.io/loader/

2

u/bradleymeck May 18 '16

They are implementing the HTML spec based loader: https://html.spec.whatwg.org/multipage/webappapis.html#resolve-a-module-specifier

They are not implementing the dynamic loader for HTML: https://whatwg.github.io/loader/ ( related: https://blog.whatwg.org/js-modules )

They do not have the necessary hooks to support a node loader: https://github.com/nodejs/node-eps/blob/master/002-es6-modules.md#reason-for-decision ( their impl: https://github.com/Microsoft/ChakraCore/blob/7587147fac16654797fca082deeef607c4f3d6a6/lib/Runtime/Language/ModuleNamespace.h does not contain a way to perform the delegation against a raw value)

-1

u/rube203 May 17 '16

As the opening paragraph of your link states, that is ES7.

2

u/jineshshah36 May 18 '16

No, it says "last week’s Windows Insider Preview build 14342 brings more ES6 capabilities including modules, default parameters, and destructuring". Then it says "Edge also supports all ES2016 (aka ES7) proposals – the exponentiation operator and Array.prototype.includes – as well as future ECMAScript proposals such as Async Functions and utility methods like Object.values/entries and String.prototype.padStart/padEnd." Then it goes on to refer to modules as ES6 modules. I read the whole thing. No where does it say that module loading is part of ES7.

12

u/vinnl May 17 '16

Module loading isn't, no. The spec only defines what the syntax should look like, not how they should be loaded.

3

u/bradleymeck May 17 '16

It does define some certain things beyond syntax, like:

  • how imported variables are live bound

  • what ModuleNamespaceObjects are (import * as this_is_a_module_namespace from "...";)

  • self referencial imports by throwing errors

  • and evaluation order of dependency tree

1

u/vinnl May 17 '16

Hmm, right. Still, all of those are things Webkit can't implement yet, right?

3

u/bradleymeck May 17 '16

Correct, there is no spec to fully load modules, even if they implement the grammar, you can't do anything w/ it except see if a string is parsed / what the import/exports are (at the C++ layer, this stuff is not exposed to JS user code).

9

u/flying-sheep May 17 '16

the kangax table only has stuff you can write a test for.

since you can’t test modules without the (not-yet-finished) module loader spec, it’s not included in the table (despite modules being the arguably most important new feature for JS)

i think it’s a mistake not to even mention modules in the table.

2

u/zossle May 17 '16

Edge just threw up support for es6 modules. This is an exciting time to live in!

5

u/lulzguard May 17 '16

ELI5 how is a rendering engine ES6 compliant? I mean shouldn't V8 be doing this job?

8

u/lhorie May 17 '16

This is for Safari Technology Preview

3

u/lulzguard May 17 '16

Safari has Nitro as JS engine, what does webkit has to do with ES6?

26

u/lhorie May 17 '16

Nitro (actually JavascriptCore) is part of Webkit http://trac.webkit.org/wiki/JavaScriptCore

6

u/lulzguard May 17 '16

TIL.

Thanks for the info.

1

u/amcsi May 17 '16

Wait, then where does V8 come in?

5

u/Recursive_Descent May 17 '16

V8 is the js runtime for Chrome. JSCore is the js runtime for Safari. Webkit is the whole browser platform that Safari uses (including rendering and js execution). Google used the rendering engine from Webkit, but eventually forked off of it.

1

u/amcsi May 17 '16

Oh wait I was under the impression that Webit was also used by Chrome. I must've gotten lost in the news of the past few years.

3

u/Recursive_Descent May 17 '16

Chrome uses Blink, which is a fork of Webkit from a few years ago. Now WebKit proper is only used by Safari.

2

u/gurenkagurenda May 18 '16

It's also worth adding that Chrome had V8 from the very beginning (I think?), and Safari has never used V8.

1

u/CreativeGPX May 17 '16

So, is Google more likely to merge the changes from JSCore or implement their own version of these features? ... In other words, how close are the projects after the fork?

4

u/Recursive_Descent May 17 '16

Google will have to implement their own version, V8 is completely different codebase from JSCore.

AFAIK Google only ever used the rendering engine of WebKit (which they forked and now call Blink), so JSCore was never part of Chrome.

1

u/Graftak9000 May 17 '16

Chromium browsers, Node JS as if now. IE, Edge, Mozilla and WebKit all have their own JS interpreter.

7

u/spankalee May 17 '16

And Safari won't get the goodies until the fall because of their slow release schedule :(

7

u/gotnate May 17 '16

But there is new purple Safari Development Preview on OS X, which is frequently updated. Maybe some day, iOS will also get purple Safari.

1

u/myrddin4242 May 17 '16

And now, my young apprentice, you shall witness the power of this fully operational ES6!

-1

u/MRoka5 May 17 '16

Based Apple ♥

0

u/[deleted] May 17 '16

[deleted]

2

u/chuckhendo May 17 '16

Do you have a link to what you read?

0

u/[deleted] May 17 '16

[deleted]

3

u/chuckhendo May 17 '16

I'm sorry, but what version of Chrome are you running? Is this Canary? That's the only version of Chrome I could get to report 100%. So "finally caught up" means that it caught up with the cutting edge development version of Chrome?

0

u/[deleted] May 17 '16

[deleted]

2

u/protators May 17 '16

you're

14

u/gerrywastaken May 17 '16

Congrats on you're browser choice, your an inspiration to us all