Creating a (p)react component library

A presentation at Rotterdam - The Hague Front-end Meetup in March 2018 in The Hague, Netherlands by Bart Waardenburg

Slide 1

Slide 1

building a component framework @ bartwaardenburg

Slide 2

Slide 2

the casus

Slide 3

Slide 3

~150 apps

Slide 4

Slide 4

Slide 5

Slide 5

Slide 6

Slide 6

Slide 7

Slide 7

Slide 8

Slide 8

Slide 9

Slide 9

Slide 10

Slide 10

“How can we work together on ~200 front

end applications with ~30 developers spread out over ~ 15 scrum teams?”

Slide 11

Slide 11

“We want developers to have as much autonomy as possible while maintaining a certain amount of alignment .”

Slide 12

Slide 12

the situation

Slide 13

Slide 13

“Every team builds their own applications based on their own front

end tech stack”

Slide 14

Slide 14

ui

related libraries in use angular@1.5.x preact@x.x.x react@16.x.x react@15.x.x angular@4.x.x jQuery@x.x.x angular@1.6.x home

grown@x.x.x moustache@x.x.x

Slide 15

Slide 15

the vision

Slide 16

Slide 16

“No two developers should have to build the same user interface component twice.”

Slide 17

Slide 17

ecosystem wishes single framework well documented style guide developer friendly designer friendly automated unit testing automated regression testing individually versioned components

Slide 18

Slide 18

“We need consolidation in frameworks to effectively work together”

Slide 19

Slide 19

framework wishes focused on components high performance small size pleasant learning curve available in

house knowledge large community stable server side rendering possible

Slide 20

Slide 20

in practice

Slide 21

Slide 21

preact just user interface components only ~ 3kb in size if you know react you know preact great templating with JSX possibility to use react components high performance in benchmarks server side rendering possible

Slide 22

Slide 22

well documented style guide

Slide 23

Slide 23

developer friendly

Slide 24

Slide 24

developer friendly

Slide 25

Slide 25

developer friendly

Slide 26

Slide 26

designer friendly

Slide 27

Slide 27

automated unit testing

Slide 28

Slide 28

automated unit testing

Slide 29

Slide 29

automated regression testing

Slide 30

Slide 30

automated regression testing

Slide 31

Slide 31

automated regression testing

Slide 32

Slide 32

individually versioned components each component has its own package.json and version lerna & yarn workspaces handle all node modules we use conventional commits for our commit messages we use commitizen and commit

lint to help with commit messages new semver component versions are derived from commit messages changelogs are generated based on commit messages components are privately hosted on our nexus repository

Slide 33

Slide 33

individually versioned components

Slide 34

Slide 34

individually versioned components

Slide 35

Slide 35

individually versioned components

Slide 36

Slide 36

individually versioned components

Slide 37

Slide 37

the future

Slide 38

Slide 38

future wishes specific versioned styling for components ( css

in

js ) cross browser regression testing …

Slide 39

Slide 39

thanks @bartwaardenburg