apache sling & friends tech meetup berlin, 25-27 … · apache sling & friends tech meetup...

44
APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling – Atomic Design approach for building Sling based websites Kamil Ciecierski, Freelance AEM Consultant

Upload: others

Post on 21-May-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

APACHE SLING & FRIENDS TECH MEETUPBERLIN, 25-27 SEPTEMBER 2017

Pattern Lab for Sling – Atomic Design approach for building Sling based websites

Kamil Ciecierski, Freelance AEM Consultant

Page 2: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Presentation plan

2

1. Importance of website style guides.

2. Atomic Design methodology.

3. Pattern Lab for Sling.

Page 3: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

3

Importance of website style guides

Page 4: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Why do we need website style guides?

4

Page 5: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Why do we need website style guides?

5

„Education is as important as documentation. A style guide can show

clients that websites are systems rather than collections of pages.”

Anna Debenham, „ Front-End Style Guides”

Page 6: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Why do we need website style guides?

6

▪ keep information about design language

▪ promote consistency and cohesion across a user

interface

▪ allow fast prototyping and validation of designs

▪ help to keep neatness in FE code structure

Page 7: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

7

Style guides in website integration process

Page 8: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Website integration process

8

AEM integration

Designers QA, Designers, PO

Style guides AEM package

FE Developers AEM Developers

Site designs

Developing style guides Integrating style guides Uploading app

Page 9: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Website integration process – feedback loop

9

AEM integration

Designers QA, Designers, PO

Style guides AEM package

FE Developers AEM Developers

Site designs

Developing style guides Integrating style guides Uploading app

Page 10: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Website integration process – feedback loop

10

AEM integration

Designers QA, Designers, PO

Style guides AEM package

FE Developers AEM Developers

Site designs

Developing style guides Integrating style guides Uploading app

Page 11: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Website integration process – feedback loop

11

AEM integration

Designers QA, Designers, PO

Style guides AEM package

FE Developers AEM Developers

Time consuming!

Site designs

Developing style guides Integrating style guides Uploading app

Page 12: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Developing style guides Integrating style guides Uploading app

Site designs Style guides

Abandoning style guides

12

AEM package

FE and AEM Developers

AEM integration

QA, Designers, PO

Assumption - FE developers have access to AEM app codebase

Page 13: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

13

What about new website features?

Page 14: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Developing style guides Integrating style guides Uploading app

Usual AEM site integration process

14

AEM integration

Designers QA, Designers, PO

AEM package

FE Developers AEM Developers

Style guidesSite designs

Page 15: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Style guides regression

15

Site designs AEM integration

Designers QA, Designers, PO

Style guides AEM package

FE Developers AEM Developers

Keeping style guides in syncwith codebase

Developing style guides Integrating style guides Uploading app

Page 16: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Style guides integration challenges

16

▪ present only few content scenarios▪ no readiness for dynamic content▪ features for design authoring not taken into account

▪ lack of components modularity▪ dependencies between components

▪ aligning with authoring features▪ manual rewriting of HTML examples into HTL scripts▪ considered as auxiliary project rather than designs foundation▪ lack of clear methodology

Page 17: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Website style guides integration improvements

17

▪ designs sessions to produce content more examples ▪ sharing information about authoring features▪ testing style guides separately▪ style guides integration automation – requires additional assumptions:

▪ AEM application and style guides integrated with templating language – dependency on custom solutions

▪ rendering website client-side

▪ introducing modularity to style guides components – building pattern libraries

Page 18: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

18

Atomic Designmethodology for building living style guides

Page 19: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Introduction to Atomic Design

19

„Atomic design is a methodology composed of five distinct stages working together to create interface design systems in a more deliberate and hierarchical manner.”

Brad Frost

Page 20: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Atomic Design patterns - atoms

20

Page 21: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Atomic Design patterns - molecules

21

Page 22: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Atomic Design patterns - organisms

22

Page 23: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Atomic Design patterns - templates

23

Page 24: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Atomic Design patterns - pages

24

Page 25: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Atomic Design patterns = AEM components?

25

Page 26: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Pattern Lab - tool for building atomic designsystems

26

Page 27: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Atomic Design for WCM project development

27

▪ patterns are suitable for WCM:▪ modular▪ dynamic content ready▪ adaptable to different (also future) channels▪ reusable in different contexts

▪ nesting of patterns increases code reusability and reduces time needed to apply design changes

▪ Pattern Lab allows to build easily and quickly modular patterns

▪ but still, patterns require FE integration with AEM application

Page 28: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

28

Developing FE in AEM vs developing style guides

Page 29: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Developing FE straight in AEM

29

▪ thanks to HTL and JS Use API, possibleto build view without authoring logic

▪ easier with tools supporting content repository sync and HTL development:

▪ Plugins for IDEs: Eclipse, IntelliJ, Brackets

▪ Slang - Gulp module

▪ integration of FE build systems with AEM application▪ front-end-maven plugin

▪ AEM Sass compiler

Page 30: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Developing FE straight in AEM - challenges

30

▪ more time consuming than building style guides▪ dependency on components, templates and content creation

▪ difficult to validate HTL scripts with different data examples▪ dependency on authoring development or script rework required

▪ less visibility of design dependencies between components▪ might enforce developing new components styles and scripts

separately, to reduce impact on the rest of them

▪ AEM component libraries might not keep enough data about design language to build new features

Page 31: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

31

Developing FE in AEM vs developing style guides

Style guides within Sling/AEM!

Page 32: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Pattern Lab for Sling

32

Page 33: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Pattern Lab for Sling

33

Page 34: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

34

Demo

Page 35: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Simplified workflow with Pattern Lab for Sling

35

Site designs AEM integration

Designers QA, Designers, POAEM package

with Pattern Lab

FE and AEM Developers

Developing app Uploading app

Page 36: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

AEM application

Simplified workflow – segregation of duties

36

Site designs AEM integration

Designers QA, Designers, PO

HTL templates

FE Developers AEM Developers

AEM package

Developing app Uploading app

data-sly-include

data-sly-template

clientlibs

Page 37: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

AEM application

Simplified workflow – view and logic separation

37

AEM integration

QA, Designers, POFE Developers

AEM Developers

Developing app

versioning

feature toggling

HTL templates

Site designs

Designers

Page 38: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Pattern Lab for Sling – benefits

38

▪ no more style guides integration▪ style guides are not only auxiliary projects anymore

▪ design language embedded in codebase

▪ true separation of view and business logic ▪ testing view without logic using raw patterns

▪ segregation of duties ▪ FE and AEM developers can do their best in what they love▪ flexibility on organizing developers workflow

▪ fast designs prototyping and validation straight on Sling/AEM instance

▪ no dependency on custom solutions or client side rendering

Page 39: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Future work

39

▪ Integration with AEM▪ Pattern Lab Template▪ Pattern component▪ AEM Annotations▪ AEM projects - tasks

▪ Patterns presenting different Sling context▪ mocking Sling bindings like resource, request

Page 40: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Are you ready for your next project? ☺

40

„The hard part is building the machine

that builds the product.”Dennis Crowley, Foursquare CEO

Page 41: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

41

Appendix

Page 42: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

References

42

▪ Atomic Design: http://atomicdesign.bradfrost.com/▪ Pattern Lab: http://patternlab.io/▪ Pattern Lab for Sling: https://github.com/deepthinkit/patternlab-for-

sling▪ Pattern Lab for Sling – demo content:

https://github.com/deepthinkit/patternlab-for-sling-demo▪ Front end style guides: http://maban.co.uk/projects/front-end-style-

guides/

Page 43: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Useful tools for building FE in AEM

43

▪ Gulp Slang: https://www.npmjs.com/package/gulp-slang▪ AEM Developer Tools: https://eclipse.adobe.com/aem/dev-tools/▪ AEM Brackets Extension: https://docs.adobe.com/docs/en/aem/6-

3/develop/dev-tools/aem-brackets.html▪ Frontend-maven-plugin: https://github.com/eirslett/frontend-maven-

plugin▪ AEM Sass Compiler: https://github.com/mickleroy/aem-sass-compiler

Page 44: APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 … · APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Pattern Lab for Sling –Atomic Design approach for building

Images used in presentation

44

▪ Slide 3 - https://1.bp.blogspot.com/-XeE07u3bQRU/WBvCieou3DI/AAAAAAAAC2I/WPdjk6hRwHUR2WNxbphb3mG453ft8YM8wCK4B/w1200-h630-p-k-no-nu/airbnb.png

▪ Slide 18-25 - http://bradfrost.com/blog/post/atomic-web-design/▪ Slide 28 - https://image.slidesharecdn.com/aem-best-practices-

150904054458-lva1-app6891/95/aem-best-practices-for-component-development-6-638.jpg?cb=1441617960

▪ Slide 38 - https://fernandofranzini.files.wordpress.com/2017/01/too-busy-to-improve.png