4. Overview ● A brief history of the Silverstripe
CMS 4 UI
● Embracing the weirdness
Disclaimer
This is NOT a WebPack, React, Redux,
GraphQL crash course.
21. ● Shipping a front end client inside a modular PHP application
● Customising JS is hard
Where the weirdness comes from
22. The UI stack
Modern Stack Legacy Stack
Dependency Yarn Manually managed + yarn
Build system Webpack+babel
Rendering React JQuery/Entwine
SS template
State management Redux Nothing
UI Library Bootstrap/Reactstrap Bootstrap + JQuery UI
Data communication Apollo+fetch JQuery
Data layer GraphQL+REST REST
CI Jest / Enzyme Nothing
23. silverstripe/admin
● LeftAndMain bits
● Core UI components
● Common helpers
● Shared libraries
Every other module
● Feature specific
components
● Feature specific
libraries
● Relies on admin
28. ● composer install --prefer-source
● Remove packages first
● Do for silverstripe/admin as well
● yarn install
● On admin as well
● yarn pattern-library
● On admin only
● yarn dev
● yarn watch
● yarn test
● yarn build
Cheat sheet
30. ● Don’t read the doc!
● Read Adrian’s blog post on how to create React Form Field
○ https://blog.jar.nz/posts/new-field-in-silverstripe
● Fork our module template
○ https://github.com/silverstripe/silverstripe-module
● Require maxime-rainville/recipe-react
○ https://github.com/maxime-rainville/recipe-react
What’s next?