►
Description
In this session we tackle moving a Vue template that was being written in HAML over to a Single-File-Component.
MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46569
A
You
can,
I
think,
I'm
recording
now
all
right.
We
have
identified
part
of
our
code
base
where
I'm.
A
B
A
Okay,
sorry,
I'm
gonna
censor
you
now
david.
We
then
fight
a
part
of
the
code
base
where
we
have
a
selector
for
view
to
mount
onto,
but
then
we're
referencing
the
component
in
haml
and
ideally
we
don't
have
haml
writing
any
view
code,
because
that
can
actually
be
a
security
issue
and
it's
actually
called
out
in
the
view
docs
as
one
of
the
number
one
cardinal
rules
of
writing
view
code
is
make
sure
you're
trusting
your
templates.
A
So
thankfully,
though,
like
no
there's
no
user
input
that
we're
injecting
into
hear
anything,
so
there
shouldn't
be
an
issue
but
we're
going
to
refactor
this.
So
I
would
I
I
do
need
you
to
help
drive
me
david,
because
I'm
I'm
going
to
lose
focus
really
fast.
I
feel
it
coming
what
I
think
I
want
to
first
just
get
this
running,
because
I
know
we're
going
to
want
to
test
it
to
make
sure
we're
doing
this
right.
So
let
me
open
up
my
terminal.
A
The
gdk,
let
me
stop
it,
let
me
refresh
it
so
it
removes
cash
and
restarts
itself
and
all
bunch
of
things
my
computer
is
taking
off
that's
great.
A
The
main
thing
we
want
to
do
here,
I
think,
is:
we
want
to
create
a
component.
I
think,
specifically
for
access
tokens
expires,
act
and
we're
going
to
wrap
we're
going
to
move
this
to
a
view
component
expires
at
field.
I
guess
oh
look!
Well
it's
all
there.
This
is
the
only
is
this
the
only
time
we
use
it
like.
Why?
Don't
we
just
use
that
component?
Maybe
we
can,
let's
check
it
out.
B
B
A
A
Okay,
so
all
you
gotta
do
is
just
replace
this
slot
with
what
we
really
want
it
to
be,
but
I
think
what
we're
going
to
miss
is
this
name.
You
know
so.
A
You
know
how
we
can
do
you
know
how
we
can
get
the
name
for
the
field.
Like
that's
the
bit,
that's
the
only
bit.
I
see
that's
where
we
would
really
need
the
hammer
here.
B
We
just
passed
it
through
from
can
we
attach
this
as
a
data
element
and
pass
it
in.
A
A
And
I
think
it
would
be
this-
I
don't
know
what
I'm
doing
anymore,
but
I
think
it'd
be
something
like
that.
Let's
let
says
like
me
every
single
time,
I
start
coding
five
minutes
and
what
am
I
doing?
I
have
no
idea.
Does
it
work
yeah?
This
is
why
I
love
peer
programming
because
it
keeps
me
it
keeps
me
honest.
I
once
I
sometimes
I
get
really
distracted
so
this
is.
B
B
A
It's
so
much
fun
though
I
love
man,
it's
just
hacking
away,
and
it's
it's
a
blast.
Let
me
okay.
This
is
now
running
great.
I.
B
A
I
come
here
to
work
that
rocks
that's
really
cool
man.
I
miss
working
at
a
coffee
shop.
I
haven't
done
that
in
a
long
time.
Are
there
other
people
kind
of.
A
A
B
B
A
B
A
A
A
Somehow
I
must
have
dragged
it
that
one
character
off.
Clearly,
that's
what
I
meant
to
do
in
my
editor
was
drag
characters
around.
That
looks
better
now.
I
see
a
little
date.
Picker
yes
sweet.
So
this
is
the
bit
that
I'm
a
little
concerned
about.
You
see
the
name
and
the
id
that
gets
automatically
generated
when
we
do
this
thing.
A
A
B
But
can
we
get?
Can
we
get
our
contacts
from
where
we,
where
we
set
up
the
from
where
we're
calling
the
view
field
and
we
get
the
context
for
where
we're
mounting
that
or
where
we're
calling
that
we
get
it
at
that
stage?.
A
Looks
like
I
don't
know
where
we're
creating
our
form.
Where
are
we
creating
the
form.
A
Yeah,
that's
that's!
Where
we're
rendering
it
we
must
be
creating
the
form.
Oh
yeah.
Here
we
go
we're
creating
the
form.
For
the
token
that
I
get
passed
into
me,
and
it
knows
like
rails
knows
it's
a
token
of
this
model
type.
Therefore
we're
going
to
give
it
these
names
like
so
I
kind
of
wondered.
What
I
really
wanted
to
know
is:
can
I
do
rails
get
form
field
name.
A
B
A
A
B
D
B
A
Yeah,
because
we
have
because
tag
name
also
is
you
know,
that's
tag
is
part
of
our
product
domain
too
yeah.
So
I'm
noticing
that
okay,
I
don't
think
we're
gonna
get
to
it.
This
one
is
this.
One
is
interesting,
but
it
looks
really
wonky.
B
Yeah
we
could,
we
could
make
a
helper.
I'm
surprised,
that's
something
that
we
haven't
had
to
do
already,
though,
to
be
honest,.
A
Maybe,
though
we
need
to
maybe
it's,
maybe
what
we
should
do
is
just
pass
the
object
name
and
and
just
build
it
ourselves
from
the
rails
perspective
from
the
view
perspective
like
it's
nice
when
rails
owns
all
of
this,
but
I'm
kind
of
concerned
about
even
the
performance
of
like
instantiating
a
whole
class
like
for
this
kind
of
thing,
like
that's,
not
a
big
deal.
A
So
which
one
would
you
prefer?
Would
you
prefer
us?
You
know
maybe
creating
some
sort
of
helper
for
us
to
do
rails
field
name
and
I
could
pass
in
my
form
and
then
expires
app.
We
could
do
that.
Try
that
out
or
I
could
do
something
we
could
do
something
like
object
name
and
I
could
get
my
object
name.
I
guess
from
it
and
then
field
name
and
I
can
get
expires
out
or
something,
and
I
can
I
could
do
it
that
way,
which
which
way.
A
Seeing
ourselves
to
that
deep
rails
knowledge,
so
I
think
I
think
this
probably
makes
the
most
sense
cool.
So
then
this
should
be
good
to
just
be
deleted
or
moved.
Let
me
just
make
sure
that
we're
passing
these
things
down
correctly.
So
I
I
still
personally
like
wrapping
these
things
into
options,
but
I
don't
think
I'm
going
to
do
that
right
now.
Do
you
do
you
think?
Do
you
like
that
approach,
or
would
you
want
to
do
something
different,
like
I
kind
of
like
passing
jason.
D
A
Okay:
let's
do
that
so
object,
name
field
name,
boom,
everybody's
happy!
Let
me
do
a
lovely.
A
All
right,
I'm
going
to
move
this
to
a
parameter
boom
or
a
variable.
I
mean
sorry.
If
we
don't
exist,
then
just
return.
If
we
do
exist,
we're
going
to
get
the
options
which
is
json
parse.
A
Options
boom,
but
I'm
pretty
sure
we
also
want
to
do
the
convert
to
do
you
know
what
I'm
talking
about.
What
does
it
convert
props
to.
A
All
right
and
I'm
just
going
to
double
check,
I'm
getting
these
right.
D
C
B
D
B
A
Nice,
so
this
name
and
the
id
are
things
that
we're
going
to
want
to
generate
and
then
the
other
things
we
just
copy
over
from
the
hammel.
So
what
we're
going
to
do
here-
and
I
don't
even
need
so
I
don't
need
to
do
this
and
I
can
actually.
A
B
Oh
duh,
I
I
once
asked
I
I
can't
it
wasn't
about
the
age,
but
I
once
asked
natalia
about
why
they
named
certain
things
the
way
they
do
in
view-
and
she
told
me
the
story
about
had
they
almost
named
one
of
their
new
books
for
react,
and
you
know
so
it's
just
one
big
joke.
A
Yeah
I've
I've
seen
I've
I've
seen
this
used
in
like
the
react
code
base
for
like
okay.
If
you
happen
to
not
have
jsx
like
here's,
you
know
the
convention
that
people
use
for
doing
the
like
react,
dot
create
component
everywhere,
whatever
we'll
just
aliase
it
as
h,
but
I
have
no
idea
why
h
was
the
alias.
A
That's
that's
interesting.
I
haven't
considered
that
anyways,
so
we're
here
passing
props
data,
I'm
just
gonna
spread
my
or
I'm
just
gonna,
even
just
pass
my
options
down,
which
means
I
can
kind
of
just
call
this
props.
If
we're
cool
with
that,
okay
expires
at
field.
A
A
A
B
B
B
C
B
A
A
B
A
Okay,
cool
we
are
now
going
to
copy
over
whatever
we're
doing
in
the
slot.
We're
going
to
copy
that
over.
So
we're
going
to
do
this
whole
thing
goes
into
here
and
obviously
it's
going
to
look
significantly
different,
but
that's
okay
looks
like
we
need
to
get
a
gl
input
in
here.
B
Let
me
just
double
check.
I
always
have
to
go
get
my
ui
library
yeah
hold
on.
I
wrote
I
wrote
one
of
these
earlier.
I
should
know
I've
already
wrote
a
forum
right
around
today.
Let
me
just
double
check:
where
is
it?
Where
is
it
okay?
So
we
have
an
id
which
is
handy
down
a
v
model
type
and
a
placeholder
is
the
general
idea,
and
then
we
also
have
a
name.
A
B
A
B
A
B
A
Well,
I
guess
somehow
I
gotta
I
got
to
I
have
to
ignore
this.
I
don't
think
I
can
disable
it
come
on
view.
A
Wait
scroll
back
down
there,
I'm
gonna!
Do
it
this
way.
B
A
B
A
B
B
A
C
A
A
I
guess,
but
I
don't
need
to
do
these
classes.
I
shouldn't
need
these
classes
at
all.
That's
great
placeholders,
I'm
gonna
just
throw
autocomplete
off,
because
I
don't
really
know
what
I'm
doing.
Yeah.
B
B
I
it
sounds
like
a
good
question
for
enrique.
I
think
he
would
know
the
answer.
A
B
B
B
A
A
A
B
A
A
B
A
A
I
really
thought
it
was.
I
really
thought
it
was
props
theta,
but
I
I
trust
you
perhaps
a
thing.
I
thought
it's
a
thing.
It's
part
of
the
piano.
B
B
B
A
A
B
B
We're
back
here
it's
a
different
color.
It's
probably
has
a
slightly
different
yeah
ui.
B
A
What
I'm
gonna
do
for
this,
though,
I'm
going
to
I'm
going
to
move
this
over
here
and
then
I'm
going
to
put
that
here
and
then
I'm
going
to
do.
B
B
B
D
B
B
B
Yeah,
I
think
so
like
I
like
building
so
far
what
I've
realized
been
working
with
the
application.
I
love
building
uis
in
general,
but
building
inputs
and
anything
that
touches
the
code
or
jobs
or
anything
like
that.
But
forms
are
faster.
C
B
B
B
B
B
B
Yes,
it
is
yeah.
Okay,
sorry,
sorry,
nope.
A
You're
good:
let's
let
us
test
against
our
pen.
B
A
A
Cool
yeah,
I'm
glad
I'm
glad
it
worked
out.
Yeah!
Oh
look!
I
can
click
on
this.
It
works
nice.
I'm
sold,
I'm
going
to
copy
the
outer
html
of
this
thing.
B
A
B
A
This
to
I
probably,
should
have
called
it
pen
dot
after
html.
That
makes
sense,
I'm
going
to
move
our
before
pen
to
call
back
before
html
and
then
I'm
going
to
open
up,
pin
dot
after
html.
A
A
Oh
yeah-
and
I
have
this
thing
so
I
can
also
just
delete
that
wrapping
one
and
we're
good.
Maybe
I
can
even
move
all
these
over
nice.
A
C
A
B
B
B
A
A
A
B
That
these,
I
actually
know
that
just
from
an
mr
I
reviewed
recently
for
preferences
is
that
these
screens
are
actually
under
a
pretty
hefty
push
to
be
refracted
interviewed,
use
the
get
lab
ui
components,
so
we
might
have
helped
somebody
take
a
step
in
the
right
direction.
C
A
That
was
awesome,
yeah,
it's
nice.
Having
these
things
live
it's
nice
having
these
things
live
in
view,
and
now
we've
gotta
write
a
test
probably-
and
I
think
this
is
a
good
example
for
like
just
doing
a
snapshot
test.
In
my
opinion,.
A
B
A
Right,
there's
no
branching
logic
here
or
anything
like
that.
Just
doing
a
shallow
mount
snapshot
makes
sense
to
me,
but
I
kind
of
do
hope
that
this
has
feature
specs
wrapped
around
it.
Let
me
get
rid
of
this
console
log.
A
B
B
It's
not
gonna
be
a
node
modules
anyway
dave.
I
can
tell
you
that.
C
B
D
A
Yeah
so
it'll
find
it
by
the
label
and
the
label
will
make
sure
like
the
ids
are
matching
and
stuff.
So
it's
that's
nice.
Is
it
just
for
personal
access
tokens
because
we
had
we're
using
this
for
a
number
of
other
access,
token
ones.
B
B
A
Oh
my
gosh,
okay,
do
you
know
how
we
can
override
this
border
style?
Have
we
done
this
before.
B
A
B
Let
me
let
me
just
have
a
very
quick
look
and
I'll
tell
you
what
we
need.
I
will
tell.
B
Welcome
to
my
welcome
to
my
nightmare.
A
B
C
B
B
Yep,
sorry,
since
we
actually
want
to
so
we
want
to
do
it
the
old
school
way
you
actually
just
want
to
set
the
border
gray
and
then
order
one
yeah.
I
see,
because
that
one
is
actually
doing
the
new
one,
which
is
the
box
shadow.
So
you
need
this
guy
and
then.
B
That's
not
liking,
oh,
you
might
have
to
add
the
exclamation
mark
to
after
them
to
make
sure
that
they
apply
correctly.
B
A
B
A
Yeah
so
that
looks
that
looks
right,
I'm
not
a
fan
of
adding
all
those
classes.
I
kind
of
wonder
I
wonder
if
we
have.
A
Yeah,
if
we've
addressed
box
shadow
anywhere
in
our
in
here,
I
kind
of
feel
like
we
might
have
done
that.
A
A
Yep,
I'm
gonna,
I'm
gonna
wrestle
with
this
another
time.
That's.
B
A
That's
a
great
idea
I'll
ask
him
if
he
knows
the
best
way
for
me
to
do
this
and
yeah.
I
know
I've
done
this
before
and
I
thought
I
created
a
class
to
to
like
make
it
look
the
the
old
style,
okay,
but
that.
A
I
think
we
may
want
to
do
that,
but
anyways
now
I'm
going
to
create
the
mr
I'm
going
to
pin
ping
enrique
like
you
mentioned
yeah,
thanks
david.
This
is
super
fun.