►
Description
YUI Open Roundtables are open discussions about all things YUI and Front End development.
A
All
right
today
is
thursday
april
10th
2014,
and
we
are
in
our
next
installment
of
the
yui
open
round
table
this
week.
We
have
as
our
special
guest
juan
de
pazzo
to
talk
about
promises,
es6
modules,
and
why,
before
I
get
things
started,
I
want
to
thank
and
I'm
sorry
gerard
for
coming
here
in
person
and
everyone
else
who
is
watching
right
now.
We
have
one
extra
viewer
on
youtube.
The
nice
thing
now
about
youtube
streaming
is
the
more
people
watching
the
world
sure
the
little
counter
will
pick
upward.
A
Anyway,
so
in
the
news
I
wanted
to
mention
that
about
20
minutes
ago
we
released
3.16.0,
which
has
a
lot
of
the
improvements
and
changes
that
juan
and
the
rest
of
yy
team
have
been
working
on.
It's
been
a
lot
of
hard
work
and
a
lot
of
a
lot
of
group
effort
to
get
that
outdoor
so
encourage
you
guys
to
check
it
out
and
try
out
the
new
features
and
stuff.
B
Hey
so
andrew
just
me
to
talk
a
little
bit
with
our
promises
and
I'm
hoping
to
to
get
something
out
of
this
conversation.
I
guess
so.
I
first
I
wanted
to
ask
you
what
you
had
in
mind
and
if
you
had
anything
in
particular
that
you
wanted
to
wanted
me
to
talk
about.
A
Yeah,
I
mean
I
think
for
me
and
personally,
but
I
know
a
lot
of
people
that
are
they've
been
reading
about
promises,
and
I
know
that
there
are
features
that
have
been
added
to
like
the
yui
code
base,
but
they
may
not
be
familiar
with
how
it
works
and
sort
of
the
syntax
involved
with
how
it's
done.
So
I
think
that
might
be
just
a
good
starting
point,
like
sort
of
maybe
what
like,
how?
B
Okay,
yeah
so
kind
of
prepared
a
few
scripts
that
I'll
I
share.
So
we
can
like
follow
along
all
the
new
api
that
I've
been
adding
to
the
yui
promises.
So
the
first
thing
you'll
notice,
is
that
all
these
examples
that
I'm
using
are
aren't
actually
using
yui
promises.
All
I'm
using
is
the
native
implementation.
That's
in
chrome!
B
You
can
check
it
out.
It's
right
now
in
chrome,
stable,
I'm
using
nightly
chrome
canary
now
because
of
a
tiny
little
change
that
I
talked
about
in
in
a
couple
minutes.
So
if
you
type
promise
in
your
debugging
tools,
you'll
see
it's
bigger,
you
see
you
have
native
promises
in
your
chrome,
oh
wow,
that's.
C
B
Deal
right,
yes,
this
is
a
very
big
deal,
not
not
so
much
because
of
having
the
promise
api
available,
but
because
it
opens
the
door
for
many
native
apis
to
start
returning
promises
like,
for
instance,
you
may
see
in
the
future.
If
you
do
something
like
exit
charity
well
equals
new
http
request
at
some
point
you
do
xhr
dot
send
this
might
even
at
some
point,
return
a
promise
or
I
don't
know,
for
instance,
there's
there
are
many.
B
I
think
there
are
other
apis
coming
up
with
promises.
The
first
one
that
comes
to
mind
is
offline.
Caching,
in
something
called
service
workers
that
are
up
to
you
in
a
bit,
but
so
yeah.
Let's,
let's
do
a
little
bit
of
file
so.
A
B
What
so,
the
basic
idea
behind
promises
is
to
it's
the
same
idea
behind
node
callbacks
right
having
an
interface
for
dealing
with
asynchronous
operations.
B
The
same
way,
node
is
based
on
a
on
a
convention
that
everything
that
has
that
it's
a
synchronous
operation
takes
a
callback
with
two
parameters
or
more
promises
are
just
an
another
convention
in
which,
instead
of
prom
functions,
asynchronous
function,
taking
up
a
callback,
they
return
an
object
with
certain
methods
and
certain
capabilities,
but
the
idea
behind
it
is
the
same.
It's
a
it's.
It's
an
interface,
a
convention
that
we
will
agree
on,
that
we
use
for
dealing
with
asynchronous
operations
and
for
combining
them
in
a
useful
way.
B
B
It's
it's!
It's
interesting
that
that
actually,
that
doesn't
have
to
do
with
you
know.
The
the
typical
selling
point
for
promises
is
that
it
helps
you
with
something
called
the
callback
hell
right,
but
it
actually
doesn't
really
have
to
do
with
it.
B
You
can
very
easily
end
up
in
called
raquel
using
promises
I'll
see
if
I
can
come
up
with
an
example
in
a
couple
of
minutes,
so,
basically
going
to
the
beginning,
a
promise
is
just
an
object
that
encapsulates
an
asynchronous
operation,
the
result
of
that
asynchronous
operation
and
whether
it
had
an
error
or
not.
A
B
Yes,
so,
let's
think
about
it
a
different
way.
So
if
you
have
a
some,
you
know
node
api,
let's,
let's
hide
this
and
assume.
I'm
writing
something.
Node
I
have
like
rfs
equals,
require
the
file
system
and
you
do
file
system
dot
with
file.
You'll,
get
say:
okay,
something
jason
and
you'll
get
a
callback.
B
So
in
when
you're
doing
this,
you're
essentially
reversing
the
order
in
which
functions
usually
work.
You
usually
expect
a
function
to
a
function,
to
take
parameters
and
give
you
something
back
as
a
return
value
right,
but
in
this
case
you're
actually
giving
them
a
function
and
your
having
the
output
of
the
function
be
instead
of
on
in
the
return
value
to
be
in
a
parameter
which
is
a
little
bit
weird,
if
you
think
about
it.
B
So
what
what
promises
do
is
actually
give
you
back
the
the
normal
behavior
of
a
function
in
a
way
and
have
that
have
that
function
that
just
some
synchro
separation
returns
something.
So
if
you
had
a
like
read
file
promise,
I
would
just
give
it
something
that
jason
and
I'll
get
at
least
a
return
value
back.
But
I
can
do
something
with
it.
B
Yeah,
you
can
go
and
do
other
things
you
can
store
it
somewhere,
which
is
something
that's
hard
to
do
with
callbacks.
It's
a
lot
easier
to
to
save
that
value
and
deal
with
later
using
promises
that
it
is
using
callbacks.
B
I
guess
I
can
show
an
example
of
that
later
too,
so,
let's
just
go
over
the
the
latest
changes
in
the
api
which
have
which
are
not
actually
like
yui
inventions,
but
they
come
with
the
with
the
native
api.
So
first
thing
is
that
we
have
promise.resolve
which
takes
whatever
value
you
have
and
gives
you
a
promise
for
that
value,
and
the
interesting
thing
is
that
it
understand
how
to
deal
with
other
promises.
So
if
you
pass
it
to
promise
or
resolve
you
pass,
another
promise.
B
B
B
Yes,
so
this
is
essentially
like
a
like
a
casting
operation
say
I
may
have
something
that
looks
like
a
string:
okay
and
force
it
to
be
a
string.
B
This
is
the
same
kind
of
operation,
but
it
does
have
the
slight
like
little
edge
case,
that
for
performance.
If
you
pass
it
a
promise,
it
will
not
return
a
new
promise,
but
it
will
return
the
same
promise.
So
if
I
run
the
script,
I
should
get
true
right,
because
I'm
getting
I
created
a
promise
called
p1
right.
I
passed
it
to
resolve
and
got
something:
that's
supposedly
b2,
but
now
I
because
of
this
inner
optimization.
B
This
is
the
dynamic
implementation
using
chrome
bonuses,
but
I'm
actually
using
chrome
canary,
because
this
change
just
landed,
maybe
a
week
or
two
ago,
based
on
some
latest
late
changes
to
the
ecmascript
spec.
So
if
you
actually,
if
you
try
this
same
script
in
chrome,
stable,
you
get
a
different
result.
B
But
let's
assume
this,
this
is
how
it
works
for
now
and
because
that's
the
new
status
of
this
pack,
so
I'm
gonna
try
to
to
go
through
all
the
tiny
little
details
and
it
may
be
a
little
boring,
but
at
least
there's
a
video
somewhere.
That
explains
all
the
details
in
case
your
someone
runs
into
them.
B
B
B
I'll
have
to
run
write
this
one.
So
let's
say
we:
we
have
also
b
equals
promise
the
reject
which
you'll
usually
give
it
an
error,
object.
B
B
This
is
just
like
a
utility
function,
but
it's
useful
in
cases
in
which
you'll
normally
throw
an
error
in
a
in
a
synchronous
api
like,
for
instance,
you
have
a
function
that
does
something
async
and
inspects
a
certain
argument,
and
you
want
it
to
be
a
string
right.
B
In
us,
in
a
synchronous
api,
you
may
do
throw
new
typer
right
right
or
string,
but
in
an
asynchronous
api
you'll
want
your
interface
to
always
return
a
promise
in
order
for
most
people
to
understand
it.
So,
instead
of
that,
you
just
can
just
do
promised,
reject
and
just
return
and
reject
the
promise
without
actually
having
to
go
through
creating
a
promise
and
calling
api.
So
this
is
like
a
shortcut
for
usually
for
exiting
early
in
your
functions,
but
another
another.
B
Its
case
is
that,
contrary
to
what
promise
that
resolve,
does
it
doesn't
really
understand
promises?
So,
if
you
have
like
p3
equals
a
promise
reset
to
be
an
error.
B
A
B
All
right
I
get
true
because
there
is
actually
the
promise
and
not
the
error
which
pass
it
along
you,
you
start
noticing
that
this,
like
I
don't
know
like
a
common
theme
here,
is
that
you
know
you.
You
think
the
api
here
is
pretty
simple
in
that
it
only
has
maybe
six
methods
you
have
promised
that
resolve
promise
that
reject
then
catch
all
and
race,
but
it's
so
full
of
little
details
that
you
start
realizing.
The
prime.
The
the
api
is
actually
really
complex.
B
Okay,
so
we
have
two
functions
for
now
and
called
reset
resolve
and
we
have
to
have
then,
which
takes
two
callbacks
one
for
the
result,
value
and
one
for
the
error
right,
let's
see
how
those
interact
with
each
other
so
and
see
again,
okay,
so
this
is
an
example
I
just
showed
and
the
value
actually
here
is
a
problem.
B
Another
way
of
creating
promises
is
using
like
new
promise
and
we're
going
to
create
a
promise,
object
and
you'll
take
a
function
in
which
you
can
do
something
inside
and
it
takes
two
which
takes
two
parameters
which
are
also
functions
that
allow
you
to
resolve
the
the
problems
in
a
certain
way,
either.
What
oh,
by
resolving
to
a
certain
value
by
resecting
it
there.
A
We
go
all
right.
That's
one
thing
that
I
had
to
catch
up
recently
is
those
arguments
are
always
the
first
one's
always
the
resolve
and
the
other
one's
the
error
case
right.
B
Yeah
so,
as
you
start
writing
code,
that
depends
on
promises.
You'll
notice
that
the
more
you
write
new
promise
you'll
realize
the
more
complicated
your
code.
It
turns
turns
out
to
be
it's
it's.
Actually,
it's
actually
a
trap
in
a
way,
because
you're
sort
of
thinking
that
you,
your
method,
has
have
to
return
promises
instead
of
modifying
other
synchronous
values.
So
my
recommendation
here
is
always
to
avoid
this
form
of
creating
promises
and
always
use
it
as
a
map
operation.
B
C
A
B
Like
outputting
this
to
the
console
or
something
no,
I'm
just
I'm
like
hitting
alert,
but
you
may
not
see
it
yeah
we're.
B
Can
you
see
the
console
yeah?
I
can
see
that
yeah?
Okay,
so
you
have
red
you
get
two
three
four
there
you
go.
That's
much
better.
Okay
promises
actually
work
in
a
very
similar
way.
You
have
then,
which
changes
the
value
of
a
promise
and
gives
you
a
new
promise
with
a
different
value.
So
if
I
have
b,
which
was
actually.
B
B
So
my
recommendation
is
to
always
use
it
the
same
way
as
you
would
be
mapping
an
array
instead
of
going
around
creating
arrays
and
assigning
values
to
it.
Just
change
the
values
of
other
arrays
in
this
case
change
the
value
of
promise
that
you
always
get
that
you
get
from
other
apis.
B
Okay,
so,
but
the
one
thing
that's
useful
here
in
creating
your
promises,
new
promise
is
that
errors
thrown
here,
which
is
a
change
that
I
just
uploaded
to
yui
3.16,
is
that
errors
here
actually
turn
your
promise
into
a
rejected
promise,
which
is
useful,
for
you
know
having
your
api
always
return,
something
consistent
instead
of
some
sometimes
throwing
errors,
and
sometimes
returning
rejected
promises.
B
Okay,
so
one
more
part
of
the
api
you
have
promise.o,
which
takes
an
array
promise
of
promises
and
gives
you
just
an
array
with
all
the
results
of
the
pharmacies.
So
if
I
do.
B
It
hasn't
resolved,
yet
this
one
will
wait
for
all
the
promises
to
to
be
resolved.
Okay
and
as
long
as
as
long
as
they
take.
If
one
of
them
is
rejected,
the
resulting
problem
will
be
rejected.
So
if,
if
this
is
like
equivalent
of
saying
okay,
I
want
to
wait
for
all
these
files
to
load
and
if
one
fail,
then
all
my
program
probably
fails.
So
I
need
to
notify
the
user
in
a
way.
What's.
B
B
This
time
you
get
an
array
with
all
the
values
okay,
so
this
is
pretty
simple,
and
this
is
probably
the
number
one
reason
you'll
want
to
use
promises
nowadays
is
that
it's
really
simple
to
say:
okay,
I
have
all
these
asynchronous
operations,
and
I
want
just
to
wait
for
all
of
them.
It's
super
simple
to
write,
but
that's
something
that
can
actually
be
done
with
in
other
ways,
with
callbacks
or
or
other
ways
of
doing
sync
operations.
B
So
you,
you
start
seeing
that
promises
are
just
more
powerful
in
certain
different
ways.
So,
okay,
this
is
one
thing
that
I
found
that
people
have
a
hard
time
understanding.
So,
if
you
don't
understand
it,
just
stop
me
and
ask
me:
ask
questions
so
this
is
like
typical.
B
B
So
yeah,
it
will
be
something
like,
like
a
fault
resistant
promise
at
all
right.
So
I
I
think
it's
the
the
standard
api
is
fine
with
having
a
very
small
api
and
that
premise
libraries
will
eventually
become
just
these
libraries
that
consume
the
native
promises
and
do
useful
stuff
with
them
like,
for
instance,
taking
a
bunch
of
them
and
maybe
allowing
them
some
of
them
to
fail
while
you're
waiting
for
of
them.
B
So
I
think
we'll
probably
start
most
of
the
innovation.
Around
promises
have
been
around
performance
lately,
at
least
from
the
community
and
as
we
get
native
support,
we'll
probably
see
less
interest
in
performance
and
most
more
interest
in
all
these
utility
functions
that
help
with
fault
tolerance
and
like
stuff,
like
I
don't
know,
retrying
after
a
failure.
B
B
Says
do
something
try
catch
yeah,
so
let's
say
you
have
a
function
that
may
fail
some
some
in
some
cases
and
throw
an
error
right
and
you
want
to
use
try
catch
to
handle
that
error
grades
with
what
you
do
is
like
wrap
the
call
of
that
function
and
try
and
do
something
in
the
error
message.
So
I
get
sometimes
an
error
and
sometimes
not
so
how
do
I
do
that
with
in
an
asynchronous
api
that
becomes
a
little
bit
harder
to
do
because
try
catch
doesn't
work.
B
So
what
you
do
is,
let's
say
I
have
a
function
that,
instead
of
sometimes
throwing
an
error,
it
returns
a
promise
that
it's
sometimes
rejected
and
sometimes
resolved.
So
I
have,
it
maybe
throws
async.
Does
that
and
so
here
we
promise
now
have
a
catch
method.
That's
simply
equivalent
to
doing
this,
calling
them
with
the
first
parameter
undefined
and
just
registering
an
error
callback.
B
So
this
sounds
like
it's
just
a
utility
function,
but
you'll
notice
that
when
you
try
to
use
it,
it
really
looks
very
much
like
using
try
catch.
You
do
return
the
value
of
this
function
that
may
or
may
not
return
a
rejected
promise
and
you
catch
the
result.
The
cuts,
the
error
and,
if
you
get
an
error,
you
return
successfully
right.
B
B
B
B
So
the
question
is:
what
happens
when
I
return
from
this
callback?
This
is
the
a
very
common
question
and
the
answer
is
that
you
get
a
result.
Promise
you
get
a
promise
that
is
actually
successfully
resolved.
You
don't
get
another
rejected
promise,
because
it's
the
same
as
you
did
here
right,
do
something
never
throws
an
error.
B
Instead,
people
expect
it
to
return
a
receptive
promise,
but
the
way
to
do
that
would
be
to
actually
okay.
So
if
you,
if
I
want
my
function,
synchronous
function
to
throw
an
error
if
it
cut
an
error,
you
do
something
like
this
right.
You
would
re-throw
the
error
in
synchronous
code
and
that's
exactly
what
you
need
to
do
in
asynchronous
code.
B
B
It's
trying
to
replicate
your
imperative
style
of
of
handling
errors.
B
Does
that
do
you
have
any
questions
about
this?
Does
this
make
sense.
B
B
Cool
so
yeah.
This
is
the
like
the
the
most
typical
gotcha
that
I've
seen
with
pharmacists
so
far,
and
it's
something
that
probably
isn't
very
well
explained
in
the
yui
docs.
So
I
probably
have
to
go
back
and
and
take
a
look
at
it
and
write
it
again.
B
Again,
this
is
how
you
do
this
in
with
a
note
api,
you
you,
you
know.
Instead
of
calling
return
a
value,
you
call
it
callback
with
the
value.
B
Okay,
let's
move
on
so
here's
something
that
actually
in
in
my
opinions
makes
the
whole
the
cost
of
using
promise
the
story
value-
and
this
is
what
I'm
showing
you
here-
is
how
to
use
generators,
which
is
a
new
es6
feature,
there's
actually
designed
to
be
used
with
lists,
but
it's
it
can
be
used
with
promises
to
simulate
synchronous,
looking
code
when
things
are
actually
synchronous.
B
So
again,
let's
say
I
have
a
promise,
a
function
that
returns
a
promise
after
some
time
like
100
milliseconds.
This
one
just
returns
a
num,
a
random
number
between
zero
and
the
value
that
requested.
B
I
have
this
tax
function
that
that's
something
under
hood
to
handle
promises
and
it
takes
a
generator
function,
which
is
a
special
kind
of
function
that
can,
on
top
of
returning
a
value
it
can
yield
values
which
is
essentially
stopping
the
execution
until
the
next
time.
You
call
the
function
and
giving
you
like
an
intermediate
result.
B
B
But
in
this
case
I'm
just
abusing
the
yield
syntax
to
have.
It
understand
promises
in
a
way
that
they
look
like
synchronous
code.
B
I'll
get
two
number
values
I
mean
five,
which
I
got
randomly
and
then
the
sum
of
those
that
is
the
return
value
of
the
function.
B
B
And
the
second
interesting
thing
here:
oh
well,
here's
another
example.
So,
instead
of
yielding
the
the
value
of
the
promise
here,
I'm
using
it
later
and
what
it
does
is,
since
this
was
waiting
for
this
promise
to
be
resolved
and
then
waiting
for
this
promise
to
resolve.
B
So
if
you,
this
is
essentially
doing
stuff
seriously
right
waiting
for
the
first
to
finish,
then
doing
the
second
one
right
in
this
case,
I'm
just
telling
okay,
yes,
start
this
synchronous
operation
and
then
I'm
waiting
for
the
values
later
on.
So
this
is
actually
a
promise.
B
It'll
return
right
away,
right,
it'll,
return,
a
promise
right
away
and
your
weight
at
the
end
for
all
of
those
two
to
be
done.
So
this
is
pretty
much
like
doing
promise
that
all
on
those
two
functions
and
then
concatenating
the
results
for
summing,
then
up
in
this
case
the
certain
numbers.
B
But
again
I'm
just
writing.
You
know
imperative
code
that
says
to
this
and
I'm
not
using
any
functions
inside
this
block
right.
B
Yeah,
it's
pretty
much
the
same
as
upgrading
synchronous
code,
but
it's
actually
async
under
code.
B
A
B
Yeah,
the
last
interesting
interesting
part
is
that
you
can
actually
use
try
catch
here,
so
you
have
a
function
that
maybe
returns
check
the
promise
and
I
can
wrap
my
yield
statement
with
try
and
maybe
I'll
get
an
error,
and
this
is
exactly
the
same
that
I
wrote
in
synchronous
code
a
while
ago,
and
I
actually
in
my
asynchronous
example
of
this
I
actually
had
to
go
and
write.
This
is
the
node
version.
B
A
So
if
you
don't
have
this
canary,
though,
what
do
you
need
to
do
to
be
able
to
get
this
to
work?
You
have
to
have
some
implementation
of
promises
right.
B
B
The
idea
is
that
yui
promises
won't
be
a
special
kind
of
promise
or
anything
like
that.
They'll
be
just
a
polyfill
and
for
you
is
3.17
or
wherever
we
decide
that
an
expression
will
be
it'll,
probably
just
register
itself
on
the
global
object,
and
so
you'll
just
add
promise
after
your
dependency
and
use
it
as
you
would
a
native
promise.
B
Yeah,
definitely
that's
what
we
want
to
do
for
for
most
of
the
positives
that
we're
working
on
like
promises
are
internationalization.
What
libraries
like
prototype.
B
Well,
the
difference
with
prototype
is
that
prototype
just
went
ahead
and
added
the
features
that
we
wanted
to
to
all
those
global
objects,
and
what
we're
doing
is
just
patching
the
random
saying
we
have.
I
have
this
environment
and
I
want
it
to
actually
conform
to
what
this
text
says.
It
needs
to
so
we're
basing
ourselves
on
standards
that
are
already
written.
B
Yeah,
that's
exactly
the
idea,
and
eventually
you
won't
need
the
polyfill.
Eventually
you
can
just
remove
it
and
have
the
the
browser
deal
with
it
or
in
node.js.
Hopefully,
in
a
few
months,
we'll
we'll
get
native
promises
too,
is.
B
Yes,
there
is
that
danger
as
long
as
that
library
conforms
with
the
standard,
you
should
be
okay
with
it.
If
you
happen
to
find
that
it
doesn't,
you
can
always
force
it
to
use
your
polyfill
right,
you
can
always
go
ahead
and
modify
the
glowed
scope.
Yes,.
A
B
We're
doing
two
things
right
now.
This
is
something
that
we're
doing
in
our
standalone
promise
implementation,
which
is
called
white
promise
on
github.
B
What
we're
doing
is
we're
leaving
along
the
the
promised
object
if
it
is
there,
even
if
it
is
a
non-native
implementation
and
we're
also
adding
another
global
variable
called
promised
polyfill,
which
contains
our
pro
our
polyfill.
B
B
A
A
C
B
Yeah
so
yeah,
I
guess
I
I
kind
of
went
through
that
a
bit
quickly.
So
yes,
every
time
that
you,
an
error,
gets
thrown
inside
a
promised
callback,
the
next,
the
the
promise
that
you
know
that,
then
return
gets
rejected,
which
is
the
way
this
is
set
up
this
way,
for
example,
this
reason
right,
so
we
want
promises
to
model
synchronous,
error
handling.
A
I
think
that
there's
a
new
supposed
feature
where
hangouts
like
this
get
publicized,
but
it
shouldn't
have
not
interesting.
B
A
B
No
so,
like
I
said,
I
think
you
can
very
easily
end
up
with
a
lot
of
callbacks,
even
right
when
writing
promises
right,
because
the
then
and
new
promise
actually
take
a
callback
right.
Let
me
show
it
to
you
here,
so
let
me
have
another
I'll,
just
modify
this
so
yeah
new
promise
takes
a
it,
takes
a
function
here
and
then
also
like
if
our
p
equals
so
foo
p.
Dot
den
also
takes
a
callback.
B
So
if
you're
not
following
this
idea
of
transforming
values
into
another,
you
can
basically
start
thinking
in
terms
of
callbacks.
Here
you
can
do
b
to
the
then
or
call
back
and
be
free
that
then
callback
and
depending
on
your
coding
style,
you
can
very
easily
end
in
a
pyramid
of
doom,
even
with
promises.
B
So
that
shouldn't
be
your
motivation,
your
motivations
should
be
having
the
same
interface
for
all
your
asynchronous
operations
in
your
system,
so
my
rules
thumb
is
to
choose
between
callbacks
and
promises
and
be
consistent
throughout
throughout
your
whole
project.
B
I've
seen
when
writing
code
of
my
own
and
from
from
a
project
that
yahoo
that
kind
of
trying
to
have
both
at
the
same
time
really
hurts
your
your
code
base.
It
becomes
really
hard
to
to
follow
so.
B
Yes,
so
my
recommendation
is
that
you
know
if
you're
going
with
promises,
it
should
be
the
common
way
of
handling
some
kind
of
separation
in
your
project,
otherwise,
just
speak
with
callbacks.
A
B
A
little
bit
about
that
yeah,
so
we've
been
doing
a
lot
of
work
on
this
area
in
the
last
couple
of
months.
B
This
is
something
that's
still
in
the
words
in
the
language,
so
there's
still
a
lot
of
stuff.
That's
changing
as
at
the
same
time
we're
developing
our
extensions
and
like
today
about
like
three
or
four
hours
ago,
both
carrie
and
eric
were
attending
a
tc
39
meeting,
which
is
the
comedy
that
designs,
the
javascript
language
and
they
were
actually
giving
feedback
based
on
what
we
we've
been
working
on
to
to
language
designers.
B
So
it
means
that
whatever
I'll
show
you
now
can
definitely
change
in
the
next
couple
of
months.
It
would
change
radically
because
we're
approaching
the
date
that
was
set
for
the
release
of
the
new
language,
which
should
be
in
november
or
december
this
year,
so
you're
saying
one
way
that
it's
going
to
get
locked
in
at
that
time.
Yes,
it's
already
locked
in
as
far
as
features
go
but
they're
still
like
they're
still
polishing.
A
B
Definitely
at
least
it
will
force
us
to
be
consistent
in
the
way
we
develop
modules
and
you
may
it.
Basically,
you
tear
down
this
barrier
of
entry.
We
have
for
many
many
communities
like
we
have
the
known
community,
that
has
tens
of
thousands
of
modules,
but
in
order
to
use
them
in
their
browser,
you
have
to
go
and
do
weird
things
with
them,
and
you
have.
We
have
this
amt
community
that
writes
in
a
slightly
different
format.
B
That
also
takes
quite
a
bit
of
effort
to
get
to
work
on
nodes,
and
then
we
have,
you
know
like
yui
modules
and
who
uses
those.
So
yes,
this
will
force
us
to
use
a
convention
that
we
all
follow.
A
B
Yes,
definitely
so,
this
is
the
basic
syntax
for
friday
module.
If
I
have
a
module
that
I.
C
B
I've
just
started
my
whole
screen.
Okay,
there
we
are,
there,
you
go
so
you
can.
You
have
the
export
keyword
which
in
which
has
been
a
reserved
word
for
quite
a
lot
of
time
in
in
javascript,
and
it
allows
you
to
support
something
from
a
module
that
could
be
like
a
variable
like
here
or
you
can
export
a
name
function
or
you
can
export
something
that's
already
defined
in
the
scope
of
your
module.
A
B
Right,
so
the
module
is
basically,
how
do
you
call
it
like
a
unit
of
code
that
exposes
some
parts
of
an
api
and
the
way
to
expose
the
parties
by
actually
supporting
things.
The
opportunity
operation
is
to
import
them
and
to
bring
in
to
your
module
or
to
your
own
code,
and
you
do
that
with
the
import
keyword.
B
So
it's
a
two-sided,
syntax
right.
You
have
the
export
side
and
the
import
side.
This
is
how
you
export
things
from
from
a
module,
and
the
main
difference
with
what's
been
doing
in
yui
is
that
in
yy,
what
we've
been
doing
is
add
stuff
to
a
common
object,
which
is
the
y.
We
did
why
the
foo
equals
foo.
B
The
main
difference
is
that
we
actually
have
separate
objects,
separate
places
in
which
we
to
which
we
export
stuff.
So
you
won't
have
other
modules
modifying
the
values
in
your
modules,
as
we
can,
as
we
do
in
yui
like,
for
instance,
we
have
modules
that
go
and
modify
the
node
class
or
the
dom
class,
or
you
know
add
extra
apis
to
why
dot
array.
This
is
where
they
read
variables.
B
That's
the
the
biggest
difference
with
what
we've
been
doing
so
far
and
on
the
import
side.
You
have
very
similar
syntax.
You
import
something
from
a
certain
module
which
is
a
string
that
identifies
that
module
pretty
much
the
same
as
in
yui.
We
have
we
assign
name
to
modules
and
you
can
change
the
value
of
of
the
name
of
the
thing.
Where
does
the
module
get
named
at?
B
So
that's
that's
a
good
question.
Basically,
you
have
module
loaders,
which
are
equivalent
to
the
yui
instance
or
the
yui
loader,
actually,
which
have
which
act
as
a
dictionary
and
those
modules
are
stored
in
those
loaders
as
and
the
names
are,
the
keys
in
the
dictionary,
but
essentially
browsers
come
with.
B
This
is
giving
us
a
total
new
way
to
to
deal
with
units
of
code
that
just
allows
us
to
declare
those
instead
of
going
through
imperative
apis
like
yy.use
and
we'll
be
able
to
do
the
same
in
the
browser
like
we'll,
have
a
module
tag
that
allows
you
to
allows
us
to
give
it
a
name
and
export
something
from
there,
and
we
essentially
just
declare
the
module
in
the
browser
and
then
from
another
module
tag.
We
can
actually
import
it.
B
A
Is
this
similar
to
like,
for
instance,
like
firefox
os
and
like
google
web,
they
have
like
files
that
look
like
this
right
like
web
apps,
there's
like
a
manifest.
B
Something
like
like
manifest
file.
B
You
know,
I
guess
in
a
way
it
it
kind
of
is
because
the
manifest
file
allows
you
to
to
like
point
to
to
several
external
resources,
so
in
a
way
yeah,
the
modules
are
here,
allows
you
to
just
create
a
module
pointing
to
to
a
javascript
file,
and
so
but
the
thing
that
actually
makes
this
really
powerful
is
oh
well,
let
me
get
something
first,
so
this
is
a
really
weird
example
that
today
was
brought
up
from
the
guys
from
microsoft
brought
up
at
the
tc79
meeting,
and
it's
something
that's
totally
unexpected
from
the
from
our
experience
today,
right
modules.
B
So
let's
say
I
have
a
full
module
that
has
a
counter
and
exports
a
function
called
increment.
That
increases
that
counter,
when
you
do
export
bar
you're,
actually
creating
a
variable
in
this
scope.
So
when
you
do
counter
plus
plus
it
will
actually
go
and
change
the
value
of
counter.
So
the
question
is:
if
I
call
increment
when
I
import
those
values,
will
it
change
the
value
of
counter
or
will
will
remain
the
same?
B
Yeah
so,
okay:
let's
do
you
understand
the
yes?
Okay,
this
one
kind
of
makes
sense,
so
I
have
a
second
module
that
imports
this
first
module.
B
B
B
A
B
But
it
doesn't
lock
it
to
the
current
value.
It
actually
locks
it
to
wearable
value.
It's
like
a
reference
too
right,
yeah,
it's
it's
a
live
reference
to
it.
B
Yes,
you
can
walk
around
it
that
way,
so
they
were
discussing
it
today.
I
don't
know
what
the
conclusion
was.
Are
they
considering
that
a
problem.
B
B
Working
okay,
yeah,
so
we've
been
using
a
project
called
the
es6
module
transpiler,
which
is
on
github.
You
can
look
it
up
and
what
it
does
is
take
a
javascript
code
that
has
import
and
it
will
export
keywords
and
if
we
have
a
mode
for
it
that
we
that
we
contributed
that
transpiles
that
code
into
y
and
yy
module,
but
it's
a
very
specific
yui
module.
That
has
certain
that
looks
a
little
bit
different
from
normal,
wi-fi
modules.
So
this
is
how
it
looks
like
it
has.
B
B
So
so
far
the
same
as
in
a
normal
yy
module
difference
start
starts
with
this
one.
So
first
we
get
an
es,
true
flag,
which
allows
the
yui
loader
to
know
that
it
needs
to
do
something.
A
little
different
with
this
kind
of
module,
and
then
we
get
okay
name
is
something
that
yui
already
gives
you
and
you
get
two
extra
parameters,
imports
and
exports.
B
Value
whatever
you
return
from
here
will
be
the
actual
exports
of
the
module,
so
ex
this
exports
variable
that
you
have
here
just
it's
just
useful
for
the
transpiler
to
to
add
stuff
to
so,
essentially
what
it
will
do
is,
instead
of,
if
you
have
code
that
looks
like
export
bar
equals,
two
will
transform
it
into.
B
C
B
Yes,
you
have
to
do
something
slightly
different,
which
is
why
we
have
it
well,
you
can
use
it
from
any
other
module,
that's
also
compile
of
cs6.
You
know
just
declare
it
as
a
dependency,
and
so,
if
you
have
a
third
module
that
does
import
foo
from
foo
you'll
get
a
yui
code
that
behaves
the
same,
but
if
you
want
to,
for
instance,
start
your
application
and
do
something
from
an
html
file
in
which
you
have
a
script
type
and
you
have
yui
there
and
you
want
to
start
your
application.
B
B
A
B
Yes,
we're
expecting.
I
want
to
start
writing
well
everyone,
but
we
expect
people
to
that
already
have
like
a
build
step
to
slowly
start
adopting
esc
modules
because
of
all
the
you
know,
the
nice
perks
of
dealing
with
syntax
instead
of
with
functions
and
be
able
to
share
it
with
others
and
well.
This
is
just
one
way
to
use
the
yui
loader
to
load
these
modules
and
have
them
you
know,
load
in
your
application.
The
same
way
you
do
it
with
y.
B
You
can
do
combo
loading
with
this.
You
can
set
up
conditional
loading
the
same
way
that
it
works
in
y
right
now,
there's
just
a
tiny
little
difference
in
how
monitors
are
declared,
but
those
are
handled
for
you
by
the
es6
module
transpiler.
B
But
the
there's
an
another
site
to
this:
it's
like
okay,
so
we
want
to
if
you're,
writing,
es6
modules
and
eventually
the
browser
will
support
this
by
default.
So
what
we
want
to
do
now,
let
me
bring
my
okay,
so
I'm
back
eventually
browser
will
support
this
by
default.
So
we
want
to
take
advantage
of
that
time
how
and
still
bring
all
the
values
of
the
yui
loader
into
the
standard
loader.
So
we
want
we'll
want
the
native
loader
to
do
combo
loading.
We
wanted
to
do
conditional
loading.
B
So
that's
what
we've
been
working
with
with
carly
and
eric
the
last
couple
of
months
to
get
up
to
to
speed
with
the
spec
and
start
writing
ways
to
modify
this
loader
to
do
all
the
things
that
we
know
that
are
really
good
for
performance
in
that
that
we've
developed
for
the
y
loader
and
so
I'll
just
leave
it.
B
B
Having
a
native
loader
of
modules
means
that
we
don't
actually
have
to
go
and
fetch
javascript
code.
That
knows
how
to
load
modules.
We
don't
have
to
go
and
fetch
something
like
the
wire
ic
right.
B
B
We
only
have
one
yeah,
so
what
we're
working
on
is
adding
these
small
extensions
to
the
native
loader
for
doing
stuff
like
conditional
loading
or
or
combo
handling,
and
we
want
them
to
be
as
small
as
possible,
so
you
can
sending
send
it
alongside
with
the
html.
B
So
you
don't
have
to
go
and
do
another
round
trip
so
essentially,
we've
eliminated,
maybe
150
milliseconds
of
all
the
of
the
usual
time
that
it
takes
a
page
to
load
which
is
quite
a
bit
for
well,
especially
if
you're,
if
you're
yahoo
right,
but
but
also
for
any
other
webpage
that
you
want
to
be
interactive
really
fast.
A
I
wanted
before
you
before
we
closed
down.
I
wanted
to
make
sure
I
gave
opportunity
for
anybody
here
had
questions
about
anything
you
had
anything.
No
people
were
basically
curious
about
how
promises
worked
and
then
the
es6
stuff.
What
what's
what's
coming
down
the
pipe?
What's
what's
still
rebuilt,.
B
B
Yeah,
it's
it
shares
a
couple
of
our
goals
in
terms
of
what
we
want
to
bring
on
top
of
the
es6
loader
we're
trying
to
align
with
it
in
in
in
most
of
what
we
can
and
share
as
much
code.
Everyone
like,
for
instance,
system.js,
allows
you
to
load
amd
modules
using
the
native
loader
or
common
js
modules
too,
and
we're
adding
to
that
yy
modules
so
eventually
you'll
be
able
to
load
all
these
legacy.
A
B
I
think
tracebacks,
oh
yeah,
yeah
yeah.
That's
there
are
a
couple
of
good
good
good
points
there.
You
know
if
hatch
and
anyone
wants
to
discuss
those,
they
can
just
pick
me
and
yeah
and
we
can
have
another
hangout.
A
Awesome
well,
thank
you
so
much
juan
for
for
updating
us
on
on
state
of
promises
on
esx
modules.
It
sounds
like
we're
getting
ready
and
we're
sort
of
you're
going
to
be
like
really
prepared
for
when
the
spec
is
finalized
and
people
start
writing
tons
of
modules
and
be
able
to
use
them
within
yy
or
use.
B
B
Yeah,
so
our
goal
right
now
is
mostly
to
be
able
to
fill
the
gaps
that
are
missing
in
the
rouster,
so
you
we're
working
mostly
on
polyfills,
getting
those
polyfills
in
good
shape
and
getting
now
the
basic
base
value
adds
of
yui
into
the
landscape.
Once
we
have
that,
we
can
start
actually
start
innovating
and.
A
B
B
They
don't
have
like
very,
very
good
names,
so
it's
not
like
you
can
google
and
run
into
them
right,
but
if
you're
at
least
aware
of,
what's
going
on,
you
can
run
into
them
and
participate
in
the
conversation,
and
you
can
always
if
you're
anyone
in
the
community
is
interested.
They
can,
you
know,
ask
me
or
eric
we'll
give
you
the
the
urls
to
the
repository
so
yeah.
There's
a
there's
been
a
lot
of
direct
communication
with
the
language
designers
in
github,
which
has
been
amazing.
That's.
A
A
I
k-l-y-e-d
always
say
it
kyle
ed.
I
know
it's
not
kyle.
It's
kiehad.
It
says
I'm
curious
with
you
guys
on
applications
with
why?
Why?
How
crazy
do
you
get
with
system
testing?
On
the
client
side,
we
have
different
stuff
hiding
and
showing,
based
on
certain
conditions,
maybe
prompts
popping
up
really
important
to
them.
B
Who
is
system
testing,
so
we
don't
have
much
in
terms
of
integration,
integration,
testing
right.
We
mostly
have
functional
and
unit
tests.
B
B
There
are
teams
that
yahoo
use
selenium
and
and
have
more
like
system
tests
right
yeah.
You
can
probably
talk
a
little
bit
about
those
a
lot
more
than
I
can
do.
A
Well,
for
every
there's,
like
9
000
tests
that
get
run
across
the
entire
framework
from
you
know,
low
level
to
high
level
widgets
in
our
rci
system,
and
we
also
do
things
like,
like
you
said,
and
functional
tests
and
unit
tests
that
give
a
good
idea.
They're,
not
you
know,
they're,
not
bulletproof,
but
they
give
a
good
idea
when
when
something
starts
breaking
basically,
since
it's
run
on
every
commit,
we
have
a
good
idea,
at
least
in
that
scope
of
what
happened.
A
B
A
Yeah
your
past,
you
know
you
didn't
you
didn't,
send
me
a
custom
log
message.
So
so
you
always
get
weird
things
like
that
that
have
unintended
side
effects
and
that
I
think,
would
be
resolved
with
like
system
testing
yeah
totally
cool.
Again
thanks
thanks
juan
for
for
coming-
and
I
appreciate
you
having
a
chance
to
tell
us
about
this
stuff.
So.
A
B
A
B
It
could
I
could
come
to
rentable
more
frequently.
Fortunately,
it's
just
off
my
usual
work
schedule
like
I
usually
leave
work
an
hour
ago,
because
I'm
ahead
of
you
four.
A
Hours
is
maybe
having
a
round
table
on
the
flip
side
of
time,
where
folks,
who
are
on
the
other
side
of
the
globe,
maybe
you
could
host
one
for
the
southern
hemisphere.
Definitely
try
something
like
that.
Maybe
in
I
know
there.
A
Cool
all
right,
we'll
talk
about
that
later.
All
right!
Thanks
everybody
for
coming
today
and
stay
tuned
for
the
next
open
round
table
next
week,
see
you
then
bye,
good.