►
From YouTube: Upgrading to Fastify 3 - Austin Akers, Microsoft
Description
Upgrading to Fastify 3 - Austin Akers, Microsoft
The lessons learned upgrading our codebase from Fastify 2.x to 3.x and how to mitigate migration headaches.
Join the speaker for live Q&A on Slack, channel - #openjs_world-development
Wednesday, June 2 from 14:20 - 14:40 PDT / 23:20 - 23:40 CEST
Thursday, June 3 from 13:00 - 13:20 PDT / 22:00 - 22:20 CEST
A
I
am
a
software
engineer
at
microsoft
and
today
we'll
be
discussing
upgrading
to
fastify
3,
but
more
so
the
lessons
learned
from
doing
that
now,
as
a
brief
overview
over
the
course
of
this
presentation,
we'll
be
going
over
how
we
upgraded
one
of
our
back-end
services,
docs
render,
which
is
a
service
that
improves
the
rendering
and
versatility
of
what
we're
able
to
do
for
the
microsoft
documentation
from
and,
as
I
said,
we
upgraded
it
from
fastify
version
2
to
fastify
version,
3..
A
Certain
topics
or
points
in
this
talk
could
prove
to
be
a
bit
a
bit
of
a
different
experience
for
you,
if
you're
not
using
typescript,
and
that's
primarily
because
of
us,
taking
advantage
of
the
type
system
provided
within
typescript
right
and
fastify
itself,
along
with
our
code
base,
are
both
written
in
typescript
next,
our
code
base
really
isn't
that
large,
and
I
say
that
you
know
relative
to
an
enterprise
code
base
right,
especially
especially
that
now
I
honestly
would
have
to
say
that
our
code
base
would
be
the
equivalent
size
of
maybe
a
view.
A
Twos
code
base
maybe
reacts,
but
I
just
wanted
to
highlight
that
specifically
because
for
individuals
who
may
have
a
larger
code
base
the
lessons
or
approaches
that
I'll
be
discussing
over
the
course
of
this
presentation
may
not
be
applicable
to
your
code
base
and,
last
but
not
least,
all
of
our
dependencies
were
current
while
upgrading.
We
didn't
have
to
worry
much
about
breaking
changes
in
other
libraries,
which
is
very
nice,
so
that
made
the
upgrade
less
complex
in
comparison
to
a
lot
of
the
upgrades
I've
done
in
the
past
on
other
projects.
A
An
example
would
be
going
from
view
two
to
view
three,
I
was
gonna,
say
angular,
one
to
angular,
2
and
so
on
right,
but
if
you
think
of,
if
you
think
a
major
versioning
upgrade
of
a
library
framework
is
going
to
break
many
parts
of
your
application,
one
thing
that
you
need
to
do
is
you
need
to
document
the
process
right
document
that
end-to-end
process
of
how
you
might
want
to
upgrade
and
tackle
that
right
and
within
doing
so
too
assess
the
possible
pain
points
within
your
application
for
for
documenting
just
about
anything,
I
typically
use
onenote.
A
I
know
some
people
use
notion.
I've
just
simply
been
using
onenote
since
college,
if
probably
even
high
school
right.
So
I'm
just
very
familiar
with
that,
but
utilize
that
or
those
those
applications
to
map
out
what
parts
or
files
of
the
code
base
that
might
give
you
trouble
over
the
course
of
the
upgrade.
A
I
also,
if
you
don't
know
already
fastify
has
a
migration
guide,
so
I
recommend,
if
you
haven't
already
look
into
that
migration
guide.
That
is
very
helpful
and
there
are
very
you.
There
are
useful
snippets
in
there.
That'll
show
distinct
examples
from
version
festival
version
two
to
fastify
version,
three
and
lesson:
two
fix
the
foundation
and
go
upwards
or,
in
other
words,
establish
a
stable
foundation
and
build
on
top
of
that.
A
A
Now
I
initially
tried
the
standard
approach
of
version
bumping
and
digging
into
the
large
list
of
errors
and
attempting
to
tackle
that
turns
out
that
wasn't
the
best
approach.
It
was
rough.
I
ended
up
abandoning
and
deleting
the
branch
because
it
was
so
bad,
which
brings
me
to
my
point
right.
A
This
upgrade
itself
took
took
me
several
tries,
so
what
I
ended
up
doing
was
creating
a
fresh
branch
and
attempted
to
find
a
different
approach,
so
what
it
initially
came
up
with,
or
what
we
eventually
came
up
with-
was
tackling
the
upgrade
incrementally
so
stripping
down
the
app
to
its
basics.
Functionality
fix
that
foundation
and
then
tackle
the
upgrade
and
well
essentially
increments
right,
so
adding
on
other
plugins
as
well,
and
the
best
part
about
this
is
that
fastify
made
that
approach
easier
because
of
its
plug-in
center
architecture.
A
Now,
as
you
can
see
to
the
right,
there
are
some
plugins
we've
created
and,
as
and
as
you
can
see
here,
we
have
render
we
have
engine
off
context,
content,
locale
and
error
right.
Well,
what
I
ended
up
doing
was
that
I
narrowed
down
the
functionality
to
a
core
plug-in
within
our
app
and
went
onward
from
there
and
that
core
plugin
was
render,
which
then
speaking
of
plugins
brings
me
to
my
next
point.
A
Inside
of
this
point,
the
plugin
system,
the
plug-in
system
changes,
were
probably
my
favorite
when
upgrading
the
error
messages,
just
in
general,
especially
around
plugins,
were
quite
helpful
after
upgrading
our
functions
after
upgrading
our
functions
became
more
concise
and
easier
to
read
and
a
great
example
of
that
is,
if
you
look
here
to
the
you
know
this:
the
code
snippets
from
version
two
to
version
three,
so
let's
go
ahead
and
take
a
look
at
that
right,
as
you
can
see
here
from
version
two
we're
exporting
a
fastified
plugin
and,
as
you
can
see
here,
we
have
three
parameters
inside
of
this
one,
stating
that
oh,
this
is
a
pastifi
that
you
know
the
instance
within
this
is
a
fastify
instance.
A
You
know
we
have
plug-in
options
and
also
next
callback,
but
if
we
take
a
look
at
version,
three
we're
able
to
consolidate
that
you
know
these
four
lines
of
code
into
one
line
and
that's
consolidated
into
the
fastify
plug-in
callback
interface.
A
Now
again,
you
know
so
you
know
this
right.
Here
is
a
great
example
of
having
you
know
of
our
function,
declarations
becoming
a
lot
more
concise
from
version
two
to
version
three
right,
and
on
top
of
this,
if
you
look
at
it,
it's
also
easier
to
understand.
A
Now,
with
all
of
that
being
stated,
I
didn't
really
just
come
to
this
conclusion
for
the
most
part,
from
looking
at
the
errors
within
the
with
you
know,
within
the
error
messages
in
the
cli
right,
although
they
were
very
helpful,
there
was
still
a
level
disconnect,
on
my
end
on
being
able
to
truly
understand
how
certain
things
work
in
the
upgrade,
which
brings
me
to
my
next
lesson,
which
is
also
a
great
point
of
reference
as
well
lesson:
three
referencing,
the
fastify
test
cases
now,
as
I
stated
before,
the
error
messages
contained
only
a
certain
amount
of
information.
A
While
it
was
very
helpful,
I
then
tried
to
go
out
and
reference
the
migration
guide
as
great
as
that
was
as
well
too.
It
also
still
had
limited
information,
and
so
what
I
ended
up,
having
had
to
do
what
I
ended
up
doing
was
going
inside
the
fastify
source
code
and
looking
at
the
test
cases
that
that
implement
things
that
I
felt
as
though
I
may
need,
or
that
you
know,
replaced
a
certain
functions
or
certain
interfaces
within
version
two.
A
A
As
you
can
see
here,
you
know
at
the
bottom,
you'll
find
a
testify,
plug-in
async
test
case
and
you'll
also
find
a
fastify
plug-in
callback
test
case
as
well,
and
these
right
here
these
test
cases
provided
a
skeleton
for
the
functions
that
I
you
know
for
my
functions
for
version
three.
You
know
for
our
code
base
when
we
were
converting
it
to
version
three
which
is
really
nice
and
to
really
put
that
into
an
example.
A
As
you
can
see
here,
what
we're
doing
is
that
we're
going
to
take
that
that
test
case
or
like
you
know
that
snippet
of
code,
which
is
the
test
plugin
async,
which
is
implementing
a
you
know,
as
I
said,
just
implementing
the
fastify
plug-in
async
interface
and
we're
going
to
go
ahead
and
try
to
convert
our
version
to
a
code
snippet
into
our
version
3..
Now
the
thought
process
that
I
took
into
you
know
converting
that
version
to
you
know
stuff.
A
Within
our
version,
2
codebase
into
version
three
was
specifically
around
plugins
was
establishing
on
o.
Is
it
a
plugin
right
now,
as
you
can
see
here
to
the
left,
we
have
site
routes,
which
is
a
plugin
as
you'll
see,
and
it's
asynchronous
right
and
the
instance
on
it
is
happens
to
be
an
instance
of
fastified.
You
know
inheritance
fastify
instance
right.
So
what
do
we?
What
can
we-
and
you
know,
what
can
we
infer
from
that?
Well,
this
right
here
happens
to
be
a
fastify
plug-in.
A
That
is
a
synchronous,
and
if
we
look
at
our
version,
three,
let's
go
ahead
and
take
that
information
that
we
learned
and
implement
that
right.
So
looking
at
that
test
case
above
as
we
can
see
here,
is
that
what
we've
learned
is
that
we
now
have
a
fastify
plug-in.
That
is
also
that
is
asynchronous
and
for
version
three,
we
did
exactly
that
right.
A
So
we
now
converted
that
version
to
cloud
into
into
version
three,
and
we
can
see
that
we
are
using
fastify
plug-in
async,
so
certain
cert,
just
a
certain
thought
process
that
went
behind
this
and
if
you
really
sometimes
even
just
talking
out
loud
and
trying
to
figure
out
figuring
out
a
lot
of
this
really
comes
to
help
in
regards
to
you
know,
in
regards
to
the
upgrade
as
well
too,
but
nonetheless,
the
test
cases
proved
to
be
very
helpful,
and
that
was
also
a
point
of
reference
that
I
went
to
a
lot
over
the
course
of
the
version.
A
Next
lesson:
4
now
I
always
want
to
say
this,
but
typescript
typescript
typescript.
I
cannot
tell
you
enough
how
having
our
codebase
in
typescript
made.
This
upgrade
substantially
substantially
less
complex
in
comparison
to
what
it
probably
would
have
been
if
we
were
using
just
vanilla,
javascript
and
that's
primarily
because
of
the
typed,
the
type
system.
A
Now
just
in
general,
I'm
sure
you
can
probably
go
online
and
find
hundreds
of
talks
about
typescript
and
about
how
amazing
it
is,
but
for
me
specifically,
especially
when
it
came
to
integrating
myself
inside
the
code
base,
but
also
you
know,
just
in
general
typescript
is
honestly
expedited
my
workflow
right
and
over
the
course
of
you
know
these.
You
know
over
the
course
of
the
upgrade
as
well,
because
of
typescript
I
was
able
to
just.
I
was
able
to
better
dissect
a
lot
of
the
errors
that
I
was
getting
right.
A
A
lot
of
these
different
error
messages
and
be
able
to
dive
in
look
at
a
lot
of
the
different
interfaces
and
types
and
being
able
to
better
understand
what
exactly
is
going
on
at
the
heart
of
these
errors,
but
also
within
fastify
as
well.
Considering
that
they
converted
their
code
base
into
typescript
and
last
but
not
least,
it
also
lowered
the
bell
curve
right
for
me
to
be
able
to
dive
in
and
to
effectively
contribute
into
the
code
base,
because
I
was
able
to
better
understand
what
exactly
was
going
on
inside
our
code
base.
A
So,
as
we
have
here
is
just
a
snippet
of
just
a
part
of
the
fastify
code
base,
you
know
just
for
loggers
and
interface
logger
interface,
so.
A
Now,
last
but
not
least,
we
also
have
lesson
five,
which
I
cannot
say
this
more
than
enough
having
test
cases
right,
in
fact,
just
having
test
coverage
in
general
turned
out
to
be
exceedingly
helpful
over
the
course
of
the
upgrade.
A
Now
again,
our
you
know,
the
test
coverage
inside
our
inside
docs
render
happened
to
be
around
70
to
80.
We
had
in
regards
to
coverage
right,
so
we
had
quite
a
quite
a
bit
of
test
cases
right
and
just
overall,
although
the
test
coverage
itself
wasn't
100,
that's
improving
right.
A
Hopefully,
you
hope
to
get
to
100
percent
test
coverage
inside
your
app,
but
70
to
80
percent
was
still
very
helpful
now
and
just
in
general
right
having
test
cases,
and
especially
during
major
upgrades
like
these,
with
breaking
changes
being
able
to
have
a
point
of
reference
and
also
being
able
to
check
how
functionality
was
before,
and
also
the
and
also
after
the
upgrade,
instilled
a
lot
more
confidence
within
the
changes
that
were
being
made
within
our
application
right,
because
the
last
thing
you
want
to
have
are
just
you
know,
having
some
sort
of
errors
that
are
that,
there's
some
silent
errors
or
just
errors
in
general
that
you
just
you
know
that
will
essentially
make
it
just
slightly
that'll,
essentially
affect
functionality
or
turn
something
to
be
slightly
off
right
and
last
but
not
least,
there
was
also
a
level
of
consistency
right
so
again,
as
I
said
it
before
there
was
that
point
of
reference
of
functionality
being
able
to
know
before
and
after
hey.
A
A
You
know
compromising
our
end
user
experience,
but
having
that
level
of
consistency
and
being
able
to
check
that
you
know
before,
and
also
after
the
upgrade
proved
to
be
a
lot
more
just
a
lot
more,
it
just
made
us
feel
a
lot
more
confident
in
regards
to
you
know
the
code
base
after
the
upgrade
and
if
you
haven't
already,
I
recommend
you
well
hey
honestly.
A
A
So
if
you
aren't
familiar
with
that
search
it
up,
I
recommend
it.
I
really
really
like
it
and
what
we
have
here
at
the
very
bottom,
as
I
said,
insert
this
code
coverage
a
a
test
case.
Tdd,
test
driven
development
is
pretty
awesome,
so
if
you
aren't
doing
it,
you
should
definitely
do
it.
Okay,
now,
with
all
those
five
lessons
covered
the
migration
well,
at
the
end,
it
was
successful
right,
but
what
exactly
made
that
migration
or
made
our
migration
successful?
A
A
Our
code
came
out
to
be
a
lot
cleaner
and
even
more
concise
than
what
it
was
in
version,
two
of
what
we're
using
for
fastify
right
and
as
we
saw
earlier
and
in
one
of
the
lessons
we
saw
how
we
were
able
to
consolidate
four
lines
of
code
into
really
one-
and
I
said,
as
you
saw,
there
was
probably
two
and
that's
because
of
the
word
wrap,
but
it
was
essentially
consolidating
four
lines
of
code
into
one
line
and
so
that
conciseness
made
it-
and
you
know
and
cleanliness
made
it-
made
it
much
much
easier
to
read
and
also
reference
back
to
whenever
it
was
necessary
when
going
over
the
course
of
the
upgrade
and
also
another
thing.
A
Many
of
our
test
cases
didn't
break
now,
granted
some
of
them
or
quite
a
few
of
them
needed
to
just
have
some
minor
tweaks
and
that's
because
of
the
upgrade
itself
right
when
you're
mocking
certain
things.
But
for
the
most
part,
a
lot
of
our
test
cases
didn't
break,
which
is
a
good
thing
which
goes
to
show
us
that
our
functionality
remained,
if
not
similar
the
exact
same
before,
but
also
after
the
upgrade,
with
some
minor
exceptions.
A
A
Smooth
now
for
recommendations
again
after
listening-
and
you
know
looking
at
the
migration
summary
going
over
our
five
lessons,
my
recommendation
for
anyone
wanting
to
upgrade
from
version
two
to
version
three.
A
First
off
document
those
changes
right
document,
the
changes
of
and
research,
those
changes
that
you
know,
that
might
prove
to
be
very
you
know,
intriguing
or
that
might
prove
to
be
a
pain
over
the
course
of
that
version
to
the
version
through
upgrade
and
also
assess
your
code
base
right
next
work
from
bottom
to
top,
so
establish
a
firm
foundation
and
build
on
top
of
that
right
now.
What
we
had
initially,
as
you
saw
was
render,
was
our
core
plug-in.
A
It
was
the
heart
of
the
application
and
being
able
to
build
up
from
there
made
everything
much
much
easier
and,
as
we
started
building
on
top
of
render,
you
know
we
were
able
to
have
even
more
points
of
reference,
but
also
having
that
strong
foundation
made
the
upgrade,
go
a
lot
smoother
and
last
and
then
another
thing
as
well,
make
sure
you
reference
the
fastify
source
code
and
also
the
test
cases,
and-
and
this
goes
for
almost
anyone
or
anything.
A
You
know
anyone
who's
wanting
to
find
ways,
or
you
know
when
doing
a
migration,
especially
a
major
migration,
wanting
to
better
understand
the
ins
and
outs
of
what
exactly
is
going
on
and
how
my
code
base
is
affected,
but
also
utilizing
that
as
a
point
of
reference
for
creating-
or
you
know,
essentially
creating
skeletons
for
a
lot
of
your
new
functions
that
or
that
you'll
be
using
right
and
another
thing
that
again,
I
recommend
everyone
does
is
take
advantage
of
typescript.
If
you
haven't
already,
please
please
do
it.
A
Typescript
is
phenomenal
and
again,
if
it
wasn't
for
our
codebase
being
in
typescript.
I
do
wholeheartedly
believe
that
our
upgrade
would
prove
to
be
a
bit
more
difficult
than
what
it
already
you
know
than
what
it
really
was,
or
could
have
been
right
so
again,
typescript
type
subscribe,
script
and,
last
but
not
least,
having
great
test
coverage
in
your
application.
A
Now
test
cases
are
amazing,
but
again
we
were
able
to
have
roughly
around
70
to
80
percent
of
our
app
just
you
know,
being
covered
in
tests,
so
test
coverages
or
test
cases
are
a
great
way
to
make
sure
that
your
that
your
application,
you
know,
has
a
specific
functionality
so
before
and
after
the
upgrade
having
that
level
of
consistency,
but
also
having
that
source
of
truth
to
reference
to
make
sure
that
nothing
breaks
silently
within
your
application
is
fantastic
in
my
opinion.
A
So
if
you
enjoyed
this
talk,
let's
connect
my
twitter
is
my
twitter.
Handler
is
what
tweetmonster999,
if
you
have
any
questions
again,
if
you
don't
want
to
connect
on
twitter
connect
with
me
on
linkedin
or
better.
Yet,
if
you
think
I'm
pretty
cool,
which
you
know,
I
think
I
kind
of
am
right,
feel
free
to
follow
me
on
github,
my
github
name
is
b-boy
acres.
Thank
you
again
for
coming
to
this
talk.
A
I
hope
you
enjoyed
it
and
I
hope
everyone
is
enjoying
not
only
just
this
conference
right,
a
lot
of
amazing
speakers
out
here
and
I
hope
that
you're
able
to
well
actually
tweet
me
if
you
find
a
really
awesome
point
or
something
interesting
that
you
just
that
you
found
out
or
or
something
you've
learned
throughout
the
course
of
this.
You
know
this
conference
so
again.
Thank
you.
I
hope
you
all
have
a
wonderful
morning
afternoon
and
evening
since
we're
all
around
the
world,
and
I
hope
to
see
you
all
again
thanks.