Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Neos Con 2023: "How to screw up a Neos project ...

Avatar for Anian Weber Anian Weber
April 28, 2023
26

Neos Con 2023: "How to screw up a Neos project - and what we learned from it" by Anian Weber

"Learn from the mistakes of others. You can't live long enough to make them all yourself." - Eleanor Roosevelt

In this talk, I would like to share some of the mistakes that we at TechDivision have made while working on Neos projects and in web development in general. Mistakes are an essential part of the learning process, and our experiences have taught us some lessons about what to do (and what not to do) in such projects.

Through this talk, I hope to share some "Schadenfreude" with you, and in the best case, offer some insights that may help you avoid pitfalls in Neos projects and web development in general.

Avatar for Anian Weber

Anian Weber

April 28, 2023

Transcript

  1. 1 COPYRIGHT © 2023 TECHDIVISION How to f*** up a

    Neos Project… …and what we learned from it Neos Con Talk 2023 by Anian Weber screw
  2. 2 COPYRIGHT © 2023 TECHDIVISION Learn from the mistakes of

    others. You can't live long enough to make them all yourself. Eleanor Roosevelt, first lady of the United States from 1933 to 1945
  3. 3 COPYRIGHT © 2023 TECHDIVISION What to expect? Share some

    mistakes that we at TechDivision have made Mistakes in Neos Projects Provide some ideas how to avoid such problems
  4. 4 COPYRIGHT © 2023 TECHDIVISION Disclaimer All of the shown

    topics, are real world examples, but they have been simplified and anonymized.
  5. 5 COPYRIGHT © 2023 TECHDIVISION Let’s share some “Schadenfreude” And

    in the best case, I hope to offer some insights
  6. 7 COPYRIGHT © 2023 TECHDIVISION The Situation How did we

    get to this point? 6 year old project Continuous feature development Regular updates 20 languages Fairly active project with ~4000 commits We wanted to updated to Neos 7.3
  7. 8 COPYRIGHT © 2023 TECHDIVISION Missing ChildNodes? Some ChildNodes where

    missing • Unclear what the exact reason for this was • Probably because the authors copy-pasted between multiple languages We decided to approach this problem with a node:repair
  8. 9 COPYRIGHT © 2023 TECHDIVISION The Problem * We don’t

    know the exact numbers anymore, but it was something in this order
  9. 10 COPYRIGHT © 2023 TECHDIVISION The Solution • To be

    sure, we made some backstop tests with BackstopJS In theory at least a default property shouldn’t “destroy” anything. Right? Manually checked the missing child nodes and orphan nodes and fixed some of them manually In addition we have written multiple migrations We built a multi step script, to execute the migrations and granularly the node:repair
  10. 11 COPYRIGHT © 2023 TECHDIVISION What have we learned from

    this? Don’t neglect your content repository and leave it unattended for multiple years Consider including some form of node:repair into your regular maintenance Consider including non destructive node:repair tasks into your deployment, like “addMissingDefaultValues” Be mindful about the implications of a node:repair
  11. 13 COPYRIGHT © 2023 TECHDIVISION The Situation How did we

    get to this point? Importer which imports products as document nodes We are importing the products into a separate workspace We then need to publish those nodes into the live workspace Publishing 4000 Nodes takes ~4 min, Publishing 8000 Nodes takes ~30 min Everything larger than this will most likely crash
  12. 16 COPYRIGHT © 2023 TECHDIVISION What have we learned from

    this? It seems like publishing scales with O(n2) Instruct customers to keep changes inside a workspace relatively small (a few thousand nodes is ok) Publish large workspaces with the CLI and maybe use a custom publish command
  13. 18 COPYRIGHT © 2023 TECHDIVISION The Situation Imagine you have

    a multi-site project with 2 sites. SiteA and SiteB You want to configure a key for an API, which differs between the 2 sites
  14. 19 COPYRIGHT © 2023 TECHDIVISION The Situation Site Package Customer.SiteA

    The Plugin Customer.ImportantPlugin Site Package Customer.SiteB
  15. 20 COPYRIGHT © 2023 TECHDIVISION The Situation If you use

    the plugin in a site, you might expect that the configuration is dependent on the current site BUT: This is not the case. Instead the site-package, which will be loaded last, will be applied to both site-packages
  16. 22 COPYRIGHT © 2023 TECHDIVISION What have we learned from

    this? Configuration will be merged completely, and isn’t site specific Consider writing a custom Eel Helper for situations where you want site specific configurations
  17. 24 COPYRIGHT © 2023 TECHDIVISION The Situation How did we

    get to this point? There are common reoccurring use cases where you want to build a plugin In almost every project we e.g. need some sort of a slider/carousel So we build a Plugin for a slider But, every customer wants slightly different variation of a slider This eventually results in overriding almost the whole slider in the projects
  18. 25 COPYRIGHT © 2023 TECHDIVISION The Solution • Best example

    for this is sandstorm/lightweightelasticsearch • They might bring a snippet, which is intended to be copy pasted into the project Plugins don’t get a concrete rendering implementation The plugin suggests an implementation for the rendering, but this is completely up to the project We defined a clear API in fusion
  19. 26 COPYRIGHT © 2023 TECHDIVISION What have we learned from

    this? Be mindful with the extend of rendering in plugins Always consider the need for customization
  20. 28 COPYRIGHT © 2023 TECHDIVISION Caches.yaml Development NodeTypes.AdventContentPage.yaml NodeTypes.AdventPage.yaml NodeTypes.BackgroundImageMixin.yaml

    NodeTypes.Color.yaml NodeTypes.ColumnCollection.yaml NodeTypes.ColumnsFullWidthMixin.yaml NodeTypes.ColumnsSpacingMixin.yaml NodeTypes.Content.Countdown.yaml NodeTypes.Content.CtaButtonLocaleDetection.yaml NodeTypes.Content.FlipCard.yaml NodeTypes.Content.FlipCardBack.yaml NodeTypes.Content.FlipCardFront.yaml NodeTypes.Content.Image.yaml NodeTypes.Content.TextWithImage.yaml NodeTypes.ContentCollection.yaml NodeTypes.Cta.Mixin.yaml NodeTypes.CtaButton.yaml NodeTypes.Divider.yaml NodeTypes.Document.LocaleDetectionPage.yaml
  21. 29 COPYRIGHT © 2023 TECHDIVISION NodeTypes.FlexMixin.yaml NodeTypes.FrontendLoginForm.yaml NodeTypes.HideElementsMixin.yaml NodeTypes.IconWithText.yaml NodeTypes.ListItem.yaml

    NodeTypes.ListPage.yaml NodeTypes.Mixin.BrandLogo.yaml NodeTypes.Mixin.MinHeightContentMixin.yaml NodeTypes.Neos.Content.ColumnLayouts.yaml NodeTypes.Neos.Content.FourColumn.yaml NodeTypes.Neos.Content.ThreeColumn.yaml NodeTypes.Neos.Content.TwoColumn.yaml NodeTypes.Neos.Content.yaml NodeTypes.OneColumn.yaml NodeTypes.Override.Flownative.AnchorLinks.NodeTypes.yaml NodeTypes.Override.Neos.Mixins.yaml NodeTypes.Override.Neos.NodeTypes.ImageCaptionMixin.yaml NodeTypes.Override.Noes.NodeTypes.Headline.yaml NodeTypes.Override.Noes.NodeTypes.Text.yaml NodeTypes.Override.TechDivision.Accordion.yaml NodeTypes.Override.TechDivision.Structure.yaml
  22. 30 COPYRIGHT © 2023 TECHDIVISION NodeTypes.Override.TechDivision.Teaser.yaml NodeTypes.Page.yaml NodeTypes.ParticipantRegistration.yaml NodeTypes.ProductFilter.yaml NodeTypes.ProductPage.yaml

    NodeTypes.ProductReferencePage.yaml NodeTypes.ProductsListPage.yaml NodeTypes.QualityAttribute.yaml NodeTypes.Quote.yaml NodeTypes.RootPage.yaml NodeTypes.Shortcut.yaml NodeTypes.StylingMixin.yaml NodeTypes.TableClass.Mixin.yaml NodeTypes.TechDivision.Blog.Author.yaml NodeTypes.TechDivision.Blog.Category.yaml NodeTypes.TechDivision.Blog.Overview.yaml NodeTypes.TechDivision.Blog.Post.yaml NodeTypes.TechDivision.Blog.TeaserRecentPosts.yaml NodeTypes.TechDivision.Gallery.yaml NodeTypes.TechDivision.Locator.Location.yaml NodeTypes.TextStylingMixin.yaml
  23. 31 COPYRIGHT © 2023 TECHDIVISION NodeTypes.TextStylingMixin.yaml NodeTypes.VisibilityMixin.yaml NodeTypes.yaml Policy.yaml Production

    Routes.yaml Settings.Customer.yaml Settings.Neos.yaml Settings.Shel.ColorPickerEditor.yaml Settings.Sitegeist.Silhouettes.yaml Settings.TechDivision.CkStyles.yaml Settings.TechDivision.yaml Views.yaml
  24. 32 COPYRIGHT © 2023 TECHDIVISION The Situation How did we

    get to this point? We have many long lasting projects They have been updated ever since old Neos versions Over the years it will accumulate countless NodeTypes in one package Becomes increasingly cluttered and confusing and therefore harder to maintain
  25. 33 COPYRIGHT © 2023 TECHDIVISION The Solution Check if there

    are unused NodeTypes Create multiple packages in your project to group similar functionalities Use the new Neos 7.2 feature to organize the NodeType Configurations
  26. 34 COPYRIGHT © 2023 TECHDIVISION What have we learned from

    this? Take time for restructuring, which often times is quite easy and painless The codebase is easier to understand if you structure your project niceley Maintenance, new features and updates become easier
  27. 36 COPYRIGHT © 2023 TECHDIVISION Let’s talk and connect I

    would love to hear about your screw ups! Anian Weber Senior Developer at TechDivision linkedin.com/in/anianweber [email protected]
  28. 37 COPYRIGHT © 2023 TECHDIVISION BE STRONG. BE REAL. BE

    DIGITAL. TechDivision GmbH TechDivision eConsulting GmbH Tel. +49 8031 22105-70 Fax +49 8031 221057-22 [email protected] www.techdivision.com Kolbermoor An der Alten Spinnerei 2 a 83059 Kolbermoor München Balanstraße 73, Haus 8 81541 MünchenÜNCHEN Hamburg Große Elbstraße 281 22767 Hamburg Leipzig Käthe-Kollwitz-Straße 60 04109 Leipzig Wien Heiligenstädter Lände 29 1190 Wien Zürich Max-Högger-Strasse 6 8048 Zürich