馃攳
Scaling the Front End - YouTube
Channel: unknown
[5]
Today,
I'm going to talk
[6]
about how design systems can
enable organizations to deliver
[11]
digital experiences with speed,
while maintaining quality
[15]
and consistency at scale.
[18]
And I'm going to base
all this on some work
[20]
that I've been doing recently
with one of our clients.
[23]
And what I hope
is to provide you
[25]
with a lot of little insights
and nuggets of information
[29]
that you can take
back, and you should be
[31]
able to apply to your own work.
[34]
So hello everyone.
[34]
My name's Ryan.
[36]
I'm a developer.
[36]
And what I really
find interesting
[38]
is that intersection
between design and code.
[42]
So I spend a lot of
time thinking about
[43]
and working on front-end
architecture and UI
[46]
development.
[47]
And so about a
year ago, I started
[49]
working with one of our
clients, Telus Digital,
[52]
to help them build and
scale their design system.
[55]
And so if you haven't
heard of Telus, that's OK.
[57]
It's because they're
a Canadian company.
[59]
And they're actually one of
the major Canadian national
[63]
telecoms, so a pretty
big organization.
[67]
And ThoughtWorks has
been partnering
[68]
with their digital arm, which
is called Telus Digital,
[72]
over the past few years.
[74]
So Telus Digital creates a
lot of their external internet
[78]
and mobile apps.
[79]
So telus.com is a very large
e-commerce and marketing site.
[84]
They have account management
websites and web applications,
[87]
a lot of one-off sites, as
well as a whole collection
[90]
of mobile
applications, as well--
[91]
so mostly web based,
but a little bit
[93]
of mobile stuff in there, too.
[95]
They've grown really quickly
over the past few years,
[97]
from a very small team into a
large, 400-person technology
[102]
organization distributed
across the country.
[105]
And with that kind
of rapid growth
[107]
comes a lot of challenges
with trying to scale.
[110]
And what I'll focus
on is their challenges
[112]
with maintaining
design consistency,
[114]
and managing their front-end
architecture complexity.
[117]
And so now I'll go
to the next slide.
[119]
If we start looking
at some examples,
[121]
these are four different
web applications
[123]
from Telus different
websites in their ecosystem.
[127]
And what you can
start to notice is
[129]
that there's a lot of
inconsistencies going on.
[132]
Notice that the header
is different in all four
[133]
of these different applications.
[135]
The search is in
a different place,
[137]
and also functions differently.
[139]
The kind of patterns in use
across these different products
[142]
are different on each page.
[144]
And if you were to actually
interact with them,
[146]
you would see that not
only is the styling
[147]
different on a lot of these
common interface elements,
[150]
but they also behave
very differently as well.
[154]
And then if you were to
look under the hood at all
[156]
of these things, you then start
to notice that there actually,
[160]
if you just take
these four, they're
[161]
actually built over time by
four different teams and four
[164]
different times.
[165]
So there's four different
text [INAUDIBLE] under there
[167]
as well.
[168]
So what Telus Digital
started to notice
[170]
was their customer experiences
were becoming more and more
[173]
disjointed, as you can see, and
the technology underneath that
[177]
was also becoming more and
more disconnected, which was
[180]
making it very hard to manage.
[183]
And so they found themselves
in a land of broken toys.
[187]
There was no real way
to share designs or code
[190]
among these different
applications,
[192]
because of all the
disconnectedness
[193]
of their technologies.
[194]
So teams had a really
hard time staying in sync,
[198]
because there is no kind of
clear definition of what things
[201]
should look like, feel
like, and how you should
[204]
interact with those things.
[206]
And so this kind of led to
a frustrating experience
[208]
for users, because
everything was different.
[210]
There was no kind
of clear journey
[212]
through all of the
different touch points,
[213]
where people could anchor
on to certain patterns
[215]
and ways of interacting
with their products.
[217]
And then they also noticed
that they were doing
[219]
a lot of duplicated effort.
[222]
Teams were building, and then
rebuilding the same things
[225]
over and over again,
which is costly.
[228]
So the example that
I like to use here
[230]
is, if you go back
to the header,
[233]
it was implemented
four different times
[235]
at least by those four different
teams in these examples I
[237]
showed you, at least.
[239]
So if I wanted to make a
change to that globally
[241]
and across the
entire site, I would
[243]
have to coordinate
with multiple teams
[245]
over multiple weeks of
build, test, and deploy just
[248]
to make one very, very
small change to the header.
[251]
And that's absolutely
unacceptable.
[254]
And this is kind of what
I want to talk about.
[258]
This isn't unique to Telus.
[260]
I think in my years
at ThoughtWorks,
[262]
I've seen the same
problem with most
[264]
of the clients I've been at.
[266]
What we have to do
is we have to change
[268]
the way that we
think about design
[271]
and about front-end development.
[272]
We have to start
attacking it strategically
[275]
and systematically, especially
when we're at scale.
[278]
This becomes very important.
[280]
So for the rest of this
talk, what I want to do
[282]
is go into how we have
kind of helped and worked
[285]
with Telus Digital to address
these challenges by adopting
[289]
what's called "design
system thinking."
[293]
So one of the first things
that Telus Digital did
[295]
was try to kind of wrap their
head around this concept,
[298]
and try and define their
vision for what it means.
[300]
And I can really break
this statement down--
[302]
this is how they defined
it-- into two main pieces.
[305]
So one, we want
to make it easier
[307]
for teams to collaborate
and communicate
[310]
so they can stay in sync.
[313]
And then two, we want to
be able to deliver digital
[315]
experiences-- web applications,
mobile apps things like that--
[319]
we want to be able
to deliver them fast,
[322]
while still maintaining
consistency and a high quality
[325]
of design and code.
[329]
And so for this talk I'm
going to break that down
[331]
into three key areas, where we
address this in different ways,
[335]
to kind of bring design systems
to life for Telus Digital.
[340]
And that's in areas of reuse,
automation, and culture.
[345]
So without further ado,
let's talk about reuse.
[348]
What we wanted to do was try
and remove the duplicated effort
[353]
that teams were doing, and kind
of be building and rebuilding
[356]
in the same kind of user
interaction patterns
[359]
and interface components
over and over,
[361]
so that we could reduce
the ongoing cost of change.
[364]
And then we also wanted to
try to unify the customer
[366]
experience by providing reusable
components to these teams.
[370]
And the primary
mechanism for doing this
[372]
is really a mindset shift.
[375]
Instead of thinking about
web pages or web applications
[378]
as a series of unique
pages or screens,
[382]
we instead think about them
as collections of components.
[386]
And these components are--
[388]
they have clean boundaries.
[389]
And they can be assembled
in different ways
[391]
to create different experiences.
[393]
And then they can be
reused by different teams
[395]
across different
applications to reduce
[398]
the ongoing costs of change
and reduce duplicated effort.
[402]
So if we take one of
their pages as an example,
[404]
this is a kind of Telus Plan
Builder, as they call it,
[407]
where I'm customizing
a phone plan.
[409]
And if we start to apply the
concept of reusable components
[412]
to this page, we
can very quickly
[413]
start to break it down
into a very small number
[416]
of components.
[418]
And then these can form
our reusable components
[421]
that get re-used across
different applications.
[424]
So after we take
that first step,
[427]
then what we can start
to see is that not all
[429]
of these components
are created equally.
[431]
If you look at something
like the heading in blue,
[434]
or the paragraph in green,
these are pretty simple.
[437]
These are your standard
typography components,
[441]
UI elements.
[442]
They don't really make
any sense unless they're
[444]
within the context of a web
page or a web application.
[446]
But if you look at something
on the bottom right
[448]
there, like the Chat
that's very different.
[451]
The Chat, sitting behind
that is maybe a person,
[456]
if you're talking to a real
person through that chat,
[458]
or some kind of AI.
[459]
It's a very, very
specific use case,
[461]
and that same Chat box might
appear exactly the same
[464]
on every single place.
[465]
You don't want to arrange
that in different places.
[468]
And so what we started to do was
take this idea of components,
[472]
which is kind of very
common these days
[474]
with technologies, such as
React or View or Angular.
[478]
And we started to
tease it apart.
[481]
And we kind of wound
up with two main kind
[483]
of categories of
components that we
[485]
use throughout Telus Digital.
[488]
If you look at the section
on the left, Global
[490]
Header, the Chat, these are what
we called "global elements."
[494]
And they're essentially
API-backed what
[496]
we call "micro front-ends"
that can be built and deployed
[501]
independently from the rest of
the page in which they operate.
[504]
And these fall
into this category,
[506]
because they're largely the
same across the entire site
[510]
or across multiple
applications within Telus,
[512]
so we want to be able to
deliver them independently.
[515]
These things maintain their
own data and their own state.
[520]
And they make their
own API calls, often
[522]
to very specific APIs that's
different than the rest
[525]
of the page.
[526]
And so for this, we
used some technologies
[529]
such as React,
Node.js, and Docker
[533]
to deploy them as containers,
so they could be independently
[536]
deployed and maintained.
[538]
And then on the right, these are
our foundational composable UI
[543]
components.
[543]
And we would distribute
them to teams as a library
[546]
that we called the
"core design system."
[548]
And teams could then take these.
[550]
They could arrange
them in different ways.
[552]
They could extend them.
[553]
They could build on top of
them with their own components,
[555]
and create the experience
that they wanted to create,
[558]
all while staying within the
bounds of the Telus interaction
[561]
patterns that we wanted
to keep and maintain
[565]
across different products.
[566]
And we used React,
again, because its focus
[569]
on component orientation is
perfect for this type of work.
[572]
And we distributed
this as an npm library,
[574]
so that teams could manage a
dependency using proper version
[578]
control and integrate
that at build time
[580]
into their application.
[581]
So a lot of really
cool things started
[583]
happening when we structured
things in this way.
[586]
We were able to
form product teams
[588]
around the global
elements, so that they
[590]
could maintain them separately
and deploy them independently.
[594]
So that problem I talked
about with the header,
[596]
you need multiple teams over
multiple weeks of coordination.
[599]
Now you can do
that with one team,
[600]
and you can deploy to
production in a matter
[602]
of minutes or hours.
[604]
And then with the design
system and these core reusable
[606]
components, teams
are able to unify
[608]
across the different
experiences like never
[611]
before, because they could
share a single source of truth
[613]
for what things should look
like, feel like, and behave.
[619]
So the next section I'll
talk about is automation.
[623]
And we really tried to drive
a mindset of let's just
[625]
automate all the things.
[627]
So as soon as new
teams start up,
[628]
they have something they
can plug into right away
[630]
and start delivering
value without having
[632]
to, again, reinvent the wheel
and build their own tooling.
[635]
So there's a lot I
could talk about here.
[638]
So instead what I want to
do is dive into something
[640]
very specific, and give you a
little more detail about it,
[644]
really show you how
something works.
[645]
And so what I want to dive
into is a specific type
[647]
of testing called "visual
regression testing."
[651]
I'm going to drive this
through an example,
[653]
and actually show
some code in a second.
[655]
But first, let's define what
"visual regression" actually
[658]
means.
[659]
So what I show you
here would be kind
[661]
of a simple, branded
button component
[663]
that you would find in the
core Telus design system.
[666]
This is actually it,
rendered in all of its glory.
[670]
So a visual regression
would be any kind
[673]
of unwanted change
to the styles,
[677]
or any unexpected change to
the visual style of that thing.
[681]
So it might be a
change to the width.
[683]
That could be a
visual regression bug.
[685]
It could be a change
to the font size.
[687]
In that case, it's
gotten bigger.
[688]
That could be a
visual regression bug.
[690]
Or it could be
something that maybe
[691]
seems a bit more
obvious, especially
[693]
with projectors and such, would
be a change to the background
[696]
color from the kind
of branded green
[698]
that we want to maybe
black, which we don't want.
[701]
And so I'll use this
for this example.
[703]
So what I want to do is walk
you through a quick example
[705]
of how this might work.
[707]
The interesting thing is,
I think to a lot of us, who
[710]
are able to distinguish between
colors very well at least,
[712]
this seems very obvious.
[713]
It's like, well,
duh that's wrong.
[715]
But historically,
this has been very
[717]
hard to do any kind of
automated testing around.
[719]
It's always had
to be someone has
[721]
to log into QA or to
production, and click
[724]
through the entire site
to make sure everything
[726]
looks all right.
[726]
And that means you
usually don't do it.
[728]
And then later, you find
out things are wrong,
[730]
and you fixed it.
[731]
But we can do better now.
[733]
So let's look at some code.
[734]
This is two tests to test the
visual regression, that button
[739]
component.
[740]
It's written using
JavaScript and React.
[742]
So if you don't know those
languages, it doesn't matter.
[744]
It's really just about
the brevity and the ideas
[746]
going on here.
[749]
The general idea
with a test like this
[751]
is that we generate
images of our components
[754]
of our application over time.
[756]
And we compare those images to
see when and if it's changing
[760]
when we expected it
to or if we didn't.
[761]
And that can tell us if there's
visual regressions happening.
[764]
In this first test, what
we actually do is we
[767]
render the button
three times in a row.
[769]
The primary one is green,
secondary one is purple,
[773]
and the inverted one
is like an inverse.
[775]
It's transparent.
[777]
In the second test, we're
doing something cool, where we
[780]
are emulating a mobile device.
[782]
And on a mobile device,
this button component
[784]
will naturally stretch to fill
the full kind of container
[788]
that it has so you have a nice,
big tap area for your finger.
[791]
And then we can start
to run tests on this.
[794]
If we execute this test
for the first time,
[796]
we'll get some output that
looks a little bit like this.
[799]
The test passed.
[800]
That's awesome.
[801]
That's what we wanted.
[802]
And the great part is, we
get a couple of screenshots
[805]
or snapshots dropped
into our codebase, one
[807]
for each of those tests.
[809]
These form what's called the
"baseline" for that component
[811]
now.
[812]
And we can check this
into our code base
[814]
so that we can remember,
this is what the button
[817]
is supposed to look like, in
this case in all three variants
[820]
that we have in
a mobile devices.
[823]
Now let's say we introduce
a visual regression.
[825]
We've actually changed
the green to black
[828]
for our primary button.
[829]
And let's see what happens.
[830]
Our tests fail.
[831]
Yay-- that's what
we wanted to happen.
[833]
And the cool part is,
we get a little bit
[835]
of output in the middle there.
[839]
What's happening with this test
is we are using a framework
[842]
to do pixel by pixel comparison
of two images to say,
[846]
is this image like that previous
image, like our baseline?
[850]
And if not, tell me how
much the variance is.
[853]
In this case, it's 1.8%.
[855]
And actually, how
many exact pixels
[857]
are different between those two
images, which is pretty neat.
[860]
And so when we execute
this and it fails,
[863]
we also get two more images
in our codebase as well.
[866]
I'm sorry for the
blurriness in that screen.
[868]
So these images this
time are pretty wide,
[870]
and it's divided
into three sections.
[873]
On the left is the
original baseline.
[875]
That's what it should look like.
[876]
And on the right is the result
of changing the green to black,
[880]
as you can see.
[881]
That's probably
not what we want.
[882]
And in the middle is the diff.
[884]
The grayed-out parts are
where the pixels match,
[886]
and the red would be
where they didn't match.
[888]
So now me, as a human, I can
go in and easily diagnose
[891]
what was going on.
[892]
And on the chance
that I actually
[894]
did want to change
the button to black,
[896]
I have a flow that
I can take to change
[898]
the baseline to that
black one, and then I
[900]
can move on from there.
[903]
I think this has been
really powerful to give us
[906]
a lot of confidence as we
work with our CSS codebase.
[911]
And on most of the projects
I've been on with ThoughtWorks,
[914]
at least the front-end
projects, that
[916]
is, the CSS has been the thing
that no one wants to touch,
[920]
no one wants to change.
[921]
And God forbid you delete
any lines from your CSS,
[923]
because you have no
idea what's going
[924]
to happen when you do that.
[926]
And so it ends up just growing,
and growing, and growing.
[928]
And the complexity
gets more and more.
[930]
But with new testing
strategies like this,
[933]
we can start to
aggressively refactor.
[934]
And actually, you can
delete lines of CSS,
[936]
and be confident that
that's not going to screw up
[938]
your entire application now.
[940]
And so we helped pioneer this
on the design system team
[943]
with Telus Digital.
[944]
And now, a lot of teams
actually run tests
[946]
just like this on larger
chunks of their application,
[950]
or even the entire thing.
[952]
And they do it in their
build pipeline on every check
[954]
into the code base.
[955]
So we have a lot of confidence
that the visual styles are
[957]
being maintained over time,
so that customer experience
[961]
is being maintained, too.
[965]
If I go on to the
last section I want
[967]
to talk about, it's
about people, and more
[970]
specifically about how
we incorporate culture
[974]
into the systems
that we're building.
[977]
While each organization
has their own culture,
[979]
at Telus Digital,
the example I'll use
[981]
is that they're very
highly built off
[982]
of agile principles as well
as open source principles.
[986]
And so we wanted to
try and embed that
[988]
into the design system.
[990]
So I want to talk about the
ownership model that we used,
[992]
and how it evolved over time.
[995]
For a long time, we had
a centralized ownership
[998]
model around some of
the reusable components
[1000]
and some of this
automated tooling,
[1002]
in which me and the rest
of the central team,
[1005]
we would produce a
product and a service
[1007]
to a lot of teams
which would consume it.
[1010]
And this is fine for simplicity
and maybe speed of delivery
[1013]
at times, but kind of over
time, as the number of consumers
[1017]
of those components
grew and the number
[1019]
of ways they wanted
to use them changed,
[1022]
it became harder and
harder to deliver
[1024]
that service and that
product in the timely manner
[1026]
that they wanted.
[1028]
And the longer
that team went on,
[1030]
the less contacts that
we had on the day-to-day
[1033]
challenges that
teams were facing,
[1035]
and the creative ways
of problem solving
[1036]
in the space of design
and front-end development.
[1039]
So we ended up--
[1040]
what we wanted to do
was better leverage
[1042]
the collective wisdom of all
the teams using this system.
[1046]
And so they've largely switched
now to a federated ownership
[1049]
model, where the key being
that direction and contribution
[1053]
to the system are largely
federated to others
[1057]
who want to be involved.
[1058]
So this equips more
people to kind of
[1060]
be evangelists of the system.
[1062]
It brings in new
perspectives and new ideas
[1064]
that we hadn't previously
thought of before.
[1067]
But a system such as
this, you can easily
[1068]
see how, as that
outside circle grows,
[1071]
this could get unwieldy and
out of hand pretty fast.
[1074]
So I think that the
central team in this model
[1077]
still remains very
important, because this
[1079]
is very similar to a lot of
open source projects out there.
[1082]
That central team can still
provide ongoing continuity,
[1087]
thought leadership,
and still provide
[1088]
underlying tooling for all
the teams trying to use this.
[1092]
So this is the model
that they currently have.
[1095]
All of these things--
the reusable components,
[1098]
global elements, and the design
system, the kind of automated
[1102]
tooling and testing
including visual regression
[1104]
testing, and the culture of
contribution and ownership--
[1108]
is all part of what's called
the Telus Design System.
[1110]
And it's open source.
[1112]
And so I invite you to
check out these two links,
[1114]
and you'll find
everything that I've
[1116]
talked about today, and a lot
more into a lot more detail.
[1118]
The top link is kind of
the main documentation
[1120]
portal that leads you to
the core component catalog.
[1124]
And the bottom link
is the codebase.
[1125]
It's under active
development right now.
[1127]
You can go check it out
and see what's going on.
[1129]
It's pretty cool.
[1130]
And so I think
I'll just leave you
[1132]
with what is this
doing at Telus Digital,
[1134]
and what can it do for you?
[1138]
What we've seen is designers
and developers on the ground
[1141]
spend less time reinventing
the wheel over and over
[1145]
and over again, and
more time solving
[1147]
the problems of the customers,
which is what their job is.
[1151]
So I think that is
more fulfilling work
[1153]
than what they may
have been doing before.
[1155]
Secondly, they're able
to deliver products
[1157]
to market much, much faster.
[1159]
Because a team has all the
tools necessary to get up
[1162]
and running very
quickly, and deploy
[1164]
digital experience to
production in a matter
[1166]
of maybe hours or even minutes.
[1169]
And then finally, the
customers are getting a better
[1171]
experience, because teams are
better able to stay in sync.
[1174]
They have reusable components
to unify the end experience.
[1177]
And so teams can stop
optimizing for individual silos,
[1182]
and they can spend
more time optimizing
[1183]
the overall experience.
[1186]
So that's all I've got.
[1187]
Thank you all very much.
[1188]
Thanks for listening.
[1189]
[APPLAUSE]
Most Recent Videos:
You can go back to the homepage right here: Homepage





