SlideShare una empresa de Scribd logo
1 de 66
Descargar para leer sin conexión
Customization-first
Vue components
Lessens learned from building Storefront UI
Filip Rakowski Co-founder @ Vue Storefront @filrakowski
Let’s do a redesign
How to make it more
reusable?
Storefront UI
storefrontui.io
github.com/DivanteLtd/storefront-ui
Why it’s good to
have component
library?
Save time on creating common UI elements
Save time on creating common UI elements
Save time on learning conventions behind UI logic
Save time on creating common UI elements
Save time on learning conventions behind UI logic
Save time on figuring out this conventions for every project
Save time on creating common UI elements
Save time on learning conventions behind UI logic
Save time on figuring out this conventions for every project
Save time on documenting UI components
Save time on creating common UI elements
Save time on learning conventions behind UI logic
Save time on figuring out this conventions for every project
Save time on documenting UI components
Help with good accessibility
Save time on creating common UI elements
Save time on learning conventions behind UI logic
Save time on figuring out this conventions for every project
Save time on documenting UI components
Help with good accessibility
Help with avoiding bugs
Save time on creating common UI elements
Save time on learning conventions behind UI logic
Save time on figuring out this conventions for every project
Save time on documenting UI components
Help with good accessibility
Help with avoiding bugs
Help with partially separating business logic from UI logic
So why we still build
a lot of things from
scratch?
Problem with
component libraries
Try to find a balance
Let’s build UI library!
…and see what problems with
components customization we can
encounter
Problem #1
What exactly we are
making? Why?
WARNING: It’s not a meme
Goals
What problem we are trying to solve?
Faster prototyping / Ability to reuse UI
atoms (buttons, inputs etc) / Having
common design system across all the
projects to omit a lot of groundwork
Who is gonna use this?
Everyone / Whole company / One team?
How they’’re gonna use this?
Copy whole pages and modify / Build
websites from scratch / Customize only
colors / Customize whole designs ?
Goals
What problem we are trying to solve?
Faster prototyping / Ability to reuse UI
atoms (buttons, inputs etc) / Having
common design system across all the
projects to omit a lot of groundwork
Who is gonna use this?
Everyone / Whole company / One team?
How they’’re gonna use this?
Copy whole pages and modify / Build
websites from scratch / Customize only
colors / Customize whole designs ?
Problem #2
How to deliver

components to the user?
Option 1
Deliver as a Vue plugin
+ Easy to understand
+ Simple installation
+ Abstraction over „installation"
process
Option 1
Deliver as a Vue plugin
+ Easy to understand
+ Simple installation
+ Abstraction over „installation"
process
- Limiting in customization
- Bad for performance (unless
you do a lot of hacks)
- Feels more distant from the
source code
- Abstraction over „installation"
process
Good tutorial on this by Linus borg
https://github.com/LinusBorg/talks/tree/master/2019-02-15%20Vue.js%20Amsterdam
Option 2
Ship „raw” source
+ Full control over imported
files
+ Great for performance
+ Better understanding of what
you’re importing
+ Direct interactions with
objects
+ No need to think about build-
time optimization and polyfills
while shipping the lib
Option 2
Ship „raw” source
+ Full control over imported
files
+ Great for performance
+ Better understanding of what
you’re importing
+ Direct interactions with
objects
+ No need to think about build-
time optimization and polyfills
while shipping the lib
Option 2
Ship „raw” source
+ Full control over imported
files
+ Great for performance
+ Better understanding of what
you’re importing
+ Direct interactions with
objects
+ No need to think about build-
time optimization and polyfills
while shipping the lib
- Requires build step on the
application level
- Requires more knowledge
about the project itself
- A bit harder to use
Option 2
Ship „raw” source
Use CopyPlugin to deliver
„production” raw sorce:
- Flatten files tree
- Ignore development-only
files
- Update imports
VS
Problem #3
Which components
should we create?
Think in Atoms
Having reasonable amount of granular (atomic)
components ensures that library can be used in almost
any context.
Instead of providing complex components specific for
some context provide context-less granular atoms that
everyone can use in any way they want.
Start with a complex component and figure out which of
it’s parts could be reusable atoms. With each new
component you’’ have less atoms to
Problem #4
How to customize
components globally?
Start with a
style guide
Style guide is a great starting point
for every project.
Define a style guide with available
colors, font sizes, headings, fonts,
spacings etc.
If possible use only those values in
components.
By doing this you can easily follow
same conventions in all of your
components.
Start with a
style guide
Make CSS/SCSS variables from
this style guide and make them
easily overridable (for example
with SCSS !default
Refer to this variables in your
components
Use one
config file
Then you can make it much easier
for others to share and reuse their
configuration
Problem #5
How to customize individual
components?
Props
Props are great if we want to
customize component for specific
use case.
They are not so good for a very
generic components though.
Props are perfectly suitable for
tasks like filling text blocks/
attributes, providing sources for
images and icons, changing
component behavior etc.
Don’t overuse props!
The main problem with props is that we tend to use
them for everything even if it doesn’t make sense and
end up with Button component having 20 props…
Don’t use props to fulfill more use cases or make
component more generic then it should.
Atoms in most cases should have either 1-3 props or
a slot.
If you have more you probably overcomplicate
stuff.
Remember that every prop is API - too many of
them makes it hard for people to be „fluent” in your
library,
Don’t use props for
CSS classes
Using props for purely CSS-related
changes is: bad for many reasons
including:
- It adds abstraction layer that
gives you absolutely nothing in
return
- It;’s harder to understand what is
happening therefore to debug/
customize component
Bad
Good
Don’t use props for
CSS classes
If some modification is done
purely in CSS don’t make
meaningless abstraction
Don’t use props to
fulfill another use
case
If you try to fulfill more and more
use cases with props maybe it’s
better to provide a slot and leave
fulfilling different use cases to
developer.s
Props are great because they give
a lot out of the box but if you cut
on customization in return it’s
usually not worth it.
Bad
Good
Slots
The best way to make
components really generic and
context-less is to use slots.
Users can pass any content they
want inside of it so there are no
direct limitation as with props.
We cut a little bit of out-of-the-
box experience but got a lot of
customization in return.
Props & Slots
You can use slots in combination
with props to make components
easy to use out of the box while
keeping them generic and highly
customizable at the same time.
Divide your components template
into sections and use them as
default slot content.
Users can replace those sections
with their own HTML if they need
to.
Btw - Imagine fulfilling every use
case here with just props
Props & Slots
You can use slots in combination
with props to make components
easy to use out of the box while
keeping them generic and highly
customizable at the same time.
Divide your components template
into sections and use them as
default slot content.
Developers can replace those
sections with their own HTML if
they need to.
Btw - Imagine fulfilling every use
case here with just props
Props
Props are great if we want to
customize component for specific
use case.
They are not so good for a very
generic components though.
Props are perfectly suitable for
tasks like filling text blocks/
attributes, providing sources for
images and icons, changing
component behavior etc.
Revenue
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id
est laborum.
200%
lorem ipsum dolor
68%
lorem ipsum dolor
184%
lorem ipsum dolor
Presentation Title
What I learned after doing
Magento PWA for 1,5 year
Speaker
Name
Position @ Vue Storefront @nick @nick
Agenda
16:00-16:15 

Introduction
16:15-16:30 

Goals
16:30-16:50 

Progressive Web Apps
16:50-17:20 

Vue Storefront
17:20-17:30 

Podsumowanie
This text is a little
introduction to
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id
est laborum.
This one
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua.
This one
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua.
This one
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua.
This one
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua.
THIS ONE
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua.
SECOND ONE
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua.
THIRD ONE HERE
Lorem ipsum dolor sit amet,
consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore
et
This one
Lorem ipsum dolor sit amet,
consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore
et
This one
Lorem ipsum dolor sit amet,
consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore
et
This one
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua.
This one
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua.
This one
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua.
This one
COMMUNITY
800 3300 85
COMMUNITY
MEMBERS
GITHUB
STARS
CONTRIBUTORS
How it works
Here you can show
future plans
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
2018
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
2019 2020
What if you want
to present few
ideas like
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
This feature
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
And this
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
And that one
That’s how you
use images
If you really have to.
Also this is 

how we do it
If you really have to.
Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor
incididunt ut labore et dolore
magna
And what about this. Pretty cool huh?
If you really have to.
Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor
incididunt ut labore et dolore
magna
specialmilano.com
by BitBull
from Singapore
nomosreddot.thehourglass.com
2014
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
ComScore
MOBILE TRAFFIC
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
Business Insider
MOBILE PAYMENTS
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
Outerbox design
MOBILE FIRST DESIGN
45% 80%

Más contenido relacionado

La actualidad más candente

How to build a Mobile API or HTML 5 app in 5 minutes
How to build a Mobile API or HTML 5 app in 5 minutesHow to build a Mobile API or HTML 5 app in 5 minutes
How to build a Mobile API or HTML 5 app in 5 minutesRobert MacLean
 
How To be a Backend developer
How To be a Backend developer    How To be a Backend developer
How To be a Backend developer Ramy Hakam
 
Ux strategy in SAP - Leverage your current investments
Ux strategy in SAP - Leverage your current investmentsUx strategy in SAP - Leverage your current investments
Ux strategy in SAP - Leverage your current investmentsTom Van Doorslaer
 
Aeternity Blockchain - Ecosystem & Devtools [2019]
Aeternity Blockchain - Ecosystem & Devtools [2019]Aeternity Blockchain - Ecosystem & Devtools [2019]
Aeternity Blockchain - Ecosystem & Devtools [2019]Przemysław Thomann
 
Ppt full stack developer
Ppt full stack developerPpt full stack developer
Ppt full stack developerSudhirVarpe1
 
Top Web Development Frameworks Comparison: All You Need To Know
Top Web Development Frameworks Comparison: All You Need To KnowTop Web Development Frameworks Comparison: All You Need To Know
Top Web Development Frameworks Comparison: All You Need To KnowPixel Crayons
 
Pros & cons of svelte
Pros & cons of sveltePros & cons of svelte
Pros & cons of svelteElenorWisozk
 
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speechVue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speechDivante
 
Internship - Bootstrap
Internship - BootstrapInternship - Bootstrap
Internship - Bootstraptanay29
 
Your First Magento 2 Module
Your First Magento 2 ModuleYour First Magento 2 Module
Your First Magento 2 ModuleBen Marks
 
MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2Mathew Beane
 
Phonegap & JqueryMobile
Phonegap & JqueryMobilePhonegap & JqueryMobile
Phonegap & JqueryMobilefinjonkiang
 
Sylius - Open Source eCommerce Framework
Sylius - Open Source eCommerce FrameworkSylius - Open Source eCommerce Framework
Sylius - Open Source eCommerce FrameworkPaweł Jędrzejewski
 
Magento 2 overview. Alan Kent
Magento 2 overview. Alan Kent Magento 2 overview. Alan Kent
Magento 2 overview. Alan Kent MeetMagentoNY2014
 
SynapseIndia gives an overview on comparison in PHP & ASP.NET in Terms of Cos...
SynapseIndia gives an overview on comparison in PHP & ASP.NET in Terms of Cos...SynapseIndia gives an overview on comparison in PHP & ASP.NET in Terms of Cos...
SynapseIndia gives an overview on comparison in PHP & ASP.NET in Terms of Cos...SynapseIndia
 
Google AMP (Accelerated Mobile Pages)
Google AMP (Accelerated Mobile Pages)Google AMP (Accelerated Mobile Pages)
Google AMP (Accelerated Mobile Pages)Chitpong Wuttanan
 

La actualidad más candente (20)

JavaScript Toolkit
JavaScript ToolkitJavaScript Toolkit
JavaScript Toolkit
 
How to build a Mobile API or HTML 5 app in 5 minutes
How to build a Mobile API or HTML 5 app in 5 minutesHow to build a Mobile API or HTML 5 app in 5 minutes
How to build a Mobile API or HTML 5 app in 5 minutes
 
How To be a Backend developer
How To be a Backend developer    How To be a Backend developer
How To be a Backend developer
 
Outlook on Magento 2
Outlook on Magento 2Outlook on Magento 2
Outlook on Magento 2
 
Ux strategy in SAP - Leverage your current investments
Ux strategy in SAP - Leverage your current investmentsUx strategy in SAP - Leverage your current investments
Ux strategy in SAP - Leverage your current investments
 
Windows 8
Windows 8Windows 8
Windows 8
 
Aeternity Blockchain - Ecosystem & Devtools [2019]
Aeternity Blockchain - Ecosystem & Devtools [2019]Aeternity Blockchain - Ecosystem & Devtools [2019]
Aeternity Blockchain - Ecosystem & Devtools [2019]
 
Website Application Developers
Website Application Developers Website Application Developers
Website Application Developers
 
Ppt full stack developer
Ppt full stack developerPpt full stack developer
Ppt full stack developer
 
Top Web Development Frameworks Comparison: All You Need To Know
Top Web Development Frameworks Comparison: All You Need To KnowTop Web Development Frameworks Comparison: All You Need To Know
Top Web Development Frameworks Comparison: All You Need To Know
 
Pros & cons of svelte
Pros & cons of sveltePros & cons of svelte
Pros & cons of svelte
 
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speechVue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
 
Internship - Bootstrap
Internship - BootstrapInternship - Bootstrap
Internship - Bootstrap
 
Your First Magento 2 Module
Your First Magento 2 ModuleYour First Magento 2 Module
Your First Magento 2 Module
 
MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2
 
Phonegap & JqueryMobile
Phonegap & JqueryMobilePhonegap & JqueryMobile
Phonegap & JqueryMobile
 
Sylius - Open Source eCommerce Framework
Sylius - Open Source eCommerce FrameworkSylius - Open Source eCommerce Framework
Sylius - Open Source eCommerce Framework
 
Magento 2 overview. Alan Kent
Magento 2 overview. Alan Kent Magento 2 overview. Alan Kent
Magento 2 overview. Alan Kent
 
SynapseIndia gives an overview on comparison in PHP & ASP.NET in Terms of Cos...
SynapseIndia gives an overview on comparison in PHP & ASP.NET in Terms of Cos...SynapseIndia gives an overview on comparison in PHP & ASP.NET in Terms of Cos...
SynapseIndia gives an overview on comparison in PHP & ASP.NET in Terms of Cos...
 
Google AMP (Accelerated Mobile Pages)
Google AMP (Accelerated Mobile Pages)Google AMP (Accelerated Mobile Pages)
Google AMP (Accelerated Mobile Pages)
 

Similar a Building resuable and customizable Vue components

Managing Creativity
Managing CreativityManaging Creativity
Managing Creativitykamaelian
 
Reworking our-workflows
Reworking our-workflowsReworking our-workflows
Reworking our-workflowsnolly00
 
Single sourcing to the max
Single sourcing to the maxSingle sourcing to the max
Single sourcing to the maxNeil Perlin
 
Top tips from what we've learned from our 10 years experience
Top tips from what we've learned from our 10 years experienceTop tips from what we've learned from our 10 years experience
Top tips from what we've learned from our 10 years experienceJoomlaDay Australia
 
8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
8 Principles for Enabling Build/Measure/Learn: Lean Engineering in ActionBill Scott
 
Plone Futures, Plone Conference 2016 Keynote by Eric Steele
Plone Futures, Plone Conference 2016 Keynote by Eric SteelePlone Futures, Plone Conference 2016 Keynote by Eric Steele
Plone Futures, Plone Conference 2016 Keynote by Eric SteeleT. Kim Nguyen
 
Thinking in Components
Thinking in ComponentsThinking in Components
Thinking in ComponentsFITC
 
Style Guide Best Practices
Style Guide Best PracticesStyle Guide Best Practices
Style Guide Best PracticesBrad Frost
 
Lean Engineering: How to make Engineering a full Lean UX partner
Lean Engineering: How to make Engineering a full Lean UX partnerLean Engineering: How to make Engineering a full Lean UX partner
Lean Engineering: How to make Engineering a full Lean UX partnerBill Scott
 
Bulletproof design systems using storybook
Bulletproof design systems using storybookBulletproof design systems using storybook
Bulletproof design systems using storybookChen Feldman
 
Exploring Our Front-End Workflows
Exploring Our Front-End WorkflowsExploring Our Front-End Workflows
Exploring Our Front-End Workflowsnolly00
 
Future proofing design work with Web components
Future proofing design work with Web componentsFuture proofing design work with Web components
Future proofing design work with Web componentsbtopro
 
WEBASSEMBLY - What's the right thing to write? -
WEBASSEMBLY - What's the right thing to write? -WEBASSEMBLY - What's the right thing to write? -
WEBASSEMBLY - What's the right thing to write? -Shin Yoshida
 
Building Large Sustainable Apps
Building Large Sustainable AppsBuilding Large Sustainable Apps
Building Large Sustainable AppsBuğra Oral
 
Developing Good Documentation
Developing Good DocumentationDeveloping Good Documentation
Developing Good DocumentationLarry Sherrod
 
Building an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learnedBuilding an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learnedWojciech Koszek
 
Accessibility in pattern libraries
Accessibility in pattern librariesAccessibility in pattern libraries
Accessibility in pattern librariesRuss Weakley
 

Similar a Building resuable and customizable Vue components (20)

Managing Creativity
Managing CreativityManaging Creativity
Managing Creativity
 
Reworking our-workflows
Reworking our-workflowsReworking our-workflows
Reworking our-workflows
 
Single sourcing to the max
Single sourcing to the maxSingle sourcing to the max
Single sourcing to the max
 
Top tips from what we've learned from our 10 years experience
Top tips from what we've learned from our 10 years experienceTop tips from what we've learned from our 10 years experience
Top tips from what we've learned from our 10 years experience
 
8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
 
Plone Futures, Plone Conference 2016 Keynote by Eric Steele
Plone Futures, Plone Conference 2016 Keynote by Eric SteelePlone Futures, Plone Conference 2016 Keynote by Eric Steele
Plone Futures, Plone Conference 2016 Keynote by Eric Steele
 
Plone Futures
Plone FuturesPlone Futures
Plone Futures
 
Thinking in Components
Thinking in ComponentsThinking in Components
Thinking in Components
 
Style Guide Best Practices
Style Guide Best PracticesStyle Guide Best Practices
Style Guide Best Practices
 
Lean Engineering: How to make Engineering a full Lean UX partner
Lean Engineering: How to make Engineering a full Lean UX partnerLean Engineering: How to make Engineering a full Lean UX partner
Lean Engineering: How to make Engineering a full Lean UX partner
 
Bulletproof design systems using storybook
Bulletproof design systems using storybookBulletproof design systems using storybook
Bulletproof design systems using storybook
 
Exploring Our Front-End Workflows
Exploring Our Front-End WorkflowsExploring Our Front-End Workflows
Exploring Our Front-End Workflows
 
Future proofing design work with Web components
Future proofing design work with Web componentsFuture proofing design work with Web components
Future proofing design work with Web components
 
WEBASSEMBLY - What's the right thing to write? -
WEBASSEMBLY - What's the right thing to write? -WEBASSEMBLY - What's the right thing to write? -
WEBASSEMBLY - What's the right thing to write? -
 
Building Large Sustainable Apps
Building Large Sustainable AppsBuilding Large Sustainable Apps
Building Large Sustainable Apps
 
Enterprise PHP
Enterprise PHPEnterprise PHP
Enterprise PHP
 
Joomla tempates talk
Joomla tempates talkJoomla tempates talk
Joomla tempates talk
 
Developing Good Documentation
Developing Good DocumentationDeveloping Good Documentation
Developing Good Documentation
 
Building an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learnedBuilding an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learned
 
Accessibility in pattern libraries
Accessibility in pattern librariesAccessibility in pattern libraries
Accessibility in pattern libraries
 

Último

原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查ydyuyu
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.krishnachandrapal52
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfJOHNBEBONYAP1
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdfMatthew Sinclair
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查ydyuyu
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制pxcywzqs
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsMonica Sydney
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理F
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasDigicorns Technologies
 
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsMira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsPriya Reddy
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdfMatthew Sinclair
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...kajalverma014
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...meghakumariji156
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge GraphsEleniIlkou
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Roommeghakumariji156
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"growthgrids
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdfMatthew Sinclair
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrHenryBriggs2
 

Último (20)

原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsMira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 

Building resuable and customizable Vue components

  • 1. Customization-first Vue components Lessens learned from building Storefront UI Filip Rakowski Co-founder @ Vue Storefront @filrakowski
  • 2. Let’s do a redesign
  • 3.
  • 4. How to make it more reusable?
  • 6. Why it’s good to have component library?
  • 7. Save time on creating common UI elements
  • 8. Save time on creating common UI elements Save time on learning conventions behind UI logic
  • 9. Save time on creating common UI elements Save time on learning conventions behind UI logic Save time on figuring out this conventions for every project
  • 10. Save time on creating common UI elements Save time on learning conventions behind UI logic Save time on figuring out this conventions for every project Save time on documenting UI components
  • 11. Save time on creating common UI elements Save time on learning conventions behind UI logic Save time on figuring out this conventions for every project Save time on documenting UI components Help with good accessibility
  • 12. Save time on creating common UI elements Save time on learning conventions behind UI logic Save time on figuring out this conventions for every project Save time on documenting UI components Help with good accessibility Help with avoiding bugs
  • 13. Save time on creating common UI elements Save time on learning conventions behind UI logic Save time on figuring out this conventions for every project Save time on documenting UI components Help with good accessibility Help with avoiding bugs Help with partially separating business logic from UI logic
  • 14. So why we still build a lot of things from scratch?
  • 16. Try to find a balance
  • 17. Let’s build UI library! …and see what problems with components customization we can encounter
  • 18.
  • 19. Problem #1 What exactly we are making? Why?
  • 21. Goals What problem we are trying to solve? Faster prototyping / Ability to reuse UI atoms (buttons, inputs etc) / Having common design system across all the projects to omit a lot of groundwork Who is gonna use this? Everyone / Whole company / One team? How they’’re gonna use this? Copy whole pages and modify / Build websites from scratch / Customize only colors / Customize whole designs ?
  • 22. Goals What problem we are trying to solve? Faster prototyping / Ability to reuse UI atoms (buttons, inputs etc) / Having common design system across all the projects to omit a lot of groundwork Who is gonna use this? Everyone / Whole company / One team? How they’’re gonna use this? Copy whole pages and modify / Build websites from scratch / Customize only colors / Customize whole designs ?
  • 23. Problem #2 How to deliver
 components to the user?
  • 24. Option 1 Deliver as a Vue plugin + Easy to understand + Simple installation + Abstraction over „installation" process
  • 25. Option 1 Deliver as a Vue plugin + Easy to understand + Simple installation + Abstraction over „installation" process - Limiting in customization - Bad for performance (unless you do a lot of hacks) - Feels more distant from the source code - Abstraction over „installation" process Good tutorial on this by Linus borg https://github.com/LinusBorg/talks/tree/master/2019-02-15%20Vue.js%20Amsterdam
  • 26. Option 2 Ship „raw” source + Full control over imported files + Great for performance + Better understanding of what you’re importing + Direct interactions with objects + No need to think about build- time optimization and polyfills while shipping the lib
  • 27. Option 2 Ship „raw” source + Full control over imported files + Great for performance + Better understanding of what you’re importing + Direct interactions with objects + No need to think about build- time optimization and polyfills while shipping the lib
  • 28. Option 2 Ship „raw” source + Full control over imported files + Great for performance + Better understanding of what you’re importing + Direct interactions with objects + No need to think about build- time optimization and polyfills while shipping the lib - Requires build step on the application level - Requires more knowledge about the project itself - A bit harder to use
  • 29. Option 2 Ship „raw” source Use CopyPlugin to deliver „production” raw sorce: - Flatten files tree - Ignore development-only files - Update imports VS
  • 31.
  • 32.
  • 33. Think in Atoms Having reasonable amount of granular (atomic) components ensures that library can be used in almost any context. Instead of providing complex components specific for some context provide context-less granular atoms that everyone can use in any way they want. Start with a complex component and figure out which of it’s parts could be reusable atoms. With each new component you’’ have less atoms to
  • 34.
  • 35. Problem #4 How to customize components globally?
  • 36. Start with a style guide Style guide is a great starting point for every project. Define a style guide with available colors, font sizes, headings, fonts, spacings etc. If possible use only those values in components. By doing this you can easily follow same conventions in all of your components.
  • 37. Start with a style guide Make CSS/SCSS variables from this style guide and make them easily overridable (for example with SCSS !default Refer to this variables in your components
  • 38. Use one config file Then you can make it much easier for others to share and reuse their configuration
  • 39. Problem #5 How to customize individual components?
  • 40. Props Props are great if we want to customize component for specific use case. They are not so good for a very generic components though. Props are perfectly suitable for tasks like filling text blocks/ attributes, providing sources for images and icons, changing component behavior etc.
  • 41. Don’t overuse props! The main problem with props is that we tend to use them for everything even if it doesn’t make sense and end up with Button component having 20 props… Don’t use props to fulfill more use cases or make component more generic then it should. Atoms in most cases should have either 1-3 props or a slot. If you have more you probably overcomplicate stuff. Remember that every prop is API - too many of them makes it hard for people to be „fluent” in your library,
  • 42. Don’t use props for CSS classes Using props for purely CSS-related changes is: bad for many reasons including: - It adds abstraction layer that gives you absolutely nothing in return - It;’s harder to understand what is happening therefore to debug/ customize component Bad Good
  • 43. Don’t use props for CSS classes If some modification is done purely in CSS don’t make meaningless abstraction
  • 44. Don’t use props to fulfill another use case If you try to fulfill more and more use cases with props maybe it’s better to provide a slot and leave fulfilling different use cases to developer.s Props are great because they give a lot out of the box but if you cut on customization in return it’s usually not worth it. Bad Good
  • 45. Slots The best way to make components really generic and context-less is to use slots. Users can pass any content they want inside of it so there are no direct limitation as with props. We cut a little bit of out-of-the- box experience but got a lot of customization in return.
  • 46. Props & Slots You can use slots in combination with props to make components easy to use out of the box while keeping them generic and highly customizable at the same time. Divide your components template into sections and use them as default slot content. Users can replace those sections with their own HTML if they need to. Btw - Imagine fulfilling every use case here with just props
  • 47. Props & Slots You can use slots in combination with props to make components easy to use out of the box while keeping them generic and highly customizable at the same time. Divide your components template into sections and use them as default slot content. Developers can replace those sections with their own HTML if they need to. Btw - Imagine fulfilling every use case here with just props
  • 48. Props Props are great if we want to customize component for specific use case. They are not so good for a very generic components though. Props are perfectly suitable for tasks like filling text blocks/ attributes, providing sources for images and icons, changing component behavior etc.
  • 49. Revenue Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 200% lorem ipsum dolor 68% lorem ipsum dolor 184% lorem ipsum dolor
  • 50. Presentation Title What I learned after doing Magento PWA for 1,5 year Speaker Name Position @ Vue Storefront @nick @nick
  • 51. Agenda 16:00-16:15 
 Introduction 16:15-16:30 
 Goals 16:30-16:50 
 Progressive Web Apps 16:50-17:20 
 Vue Storefront 17:20-17:30 
 Podsumowanie
  • 52. This text is a little introduction to Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. This one
  • 53. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. This one Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. This one Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. This one
  • 54. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. THIS ONE Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. SECOND ONE Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. THIRD ONE HERE
  • 55. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et This one Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et This one Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et This one
  • 56. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. This one Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. This one Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. This one
  • 59. Here you can show future plans Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna 2018 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna 2019 2020
  • 60. What if you want to present few ideas like Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna This feature Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna And this Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna And that one
  • 61. That’s how you use images If you really have to.
  • 62. Also this is 
 how we do it If you really have to. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
  • 63. And what about this. Pretty cool huh? If you really have to. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
  • 66. 2014 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna ComScore MOBILE TRAFFIC Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna Business Insider MOBILE PAYMENTS Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna Outerbox design MOBILE FIRST DESIGN 45% 80%