LogoLogo
  • Planet 4
  • Development
    • Contribute
    • Installation
    • Git Guidelines
    • Coding Standards
    • Continuous Delivery
  • CI/CD
    • Test Instances
    • Deployment
    • Testing
      • End-to-end Tests
      • Visual Regression Tests
  • NRO Customization
    • Development
      • Using Child Themes
      • Package Registry
      • Plugins
    • Testing
      • Visual Regression Tests
    • Deployment
      • Production
      • DB/Media Sync
  • Infrastructure
    • NRO Generation
    • ElasticSearch
    • Cloudflare
  • Recipes
    • Maintenance page
    • Production sync
    • Running commands
  • Platform
    • Practices
    • ADRs
      • [ADR-0001] Use Gitbook for Technical Documentation
      • [ADR-0002] P3 Archive elastic search integration
      • [ADR-0003] WYSIWYG Blocks Architecture
      • [ADR-0004] Switch to Monorepo
      • [ADR-0006] Define scope for deployment environments
      • [ADR-0008] PSR-4 Autoloading Standard
      • [ADR-0009] Include Media Library in master theme
      • [ADR-0011] PHP Coding Standards
      • [ADR-0012] Use custom SCSS syntax for variables
      • [ADR-0013] Choose a ticketing system
      • [ADR-0014] Choose a testing framework
      • [ADR-0015] Use block templates to build block patterns
      • [ADR-0016] Form Builder data retention policy
      • [ADR-0017] Move blocks into the theme
    • Changelog
      • 2024
      • 2023
      • 2022
      • 2021
      • 2020
      • 2019
      • 2018
  • Tech
    • Wordpress
    • Blocks
    • Plugins
    • Hooks
    • Data migrations
    • CSS variables
Powered by GitBook
On this page
  • Context and Problem Statement
  • Considered Options
  • Decision Outcome
  • Pros and Cons of the Options
  • Links
Edit on GitHub
  1. Platform
  2. ADRs

[ADR-0017] Move blocks into the theme

Move all code to the theme and retire the plugin.

Previous[ADR-0016] Form Builder data retention policyNextChangelog

Last updated 5 months ago

  • Status: accepted

  • Deciders: Development Team

Technical Story: Unify the application code into one repository.

Context and Problem Statement

After minimizing our set of repositories (as part of ), we currently have two repositories. One for the theme and one for the blocks.

There are still things that interconnected between the two repositories that increase complexity. Some examples:

  • The theme is still being used as a submodule in the plugin.

  • Test instances sometimes get broken because of a leftover branch from the other repo not involved in the current PR.

  • We do tag both repositories on release, even though they don’t both have new changes.

Considered Options

  • Move blocks into the theme and retire the plugin completely.

  • Keep maintaining the blocks into its own repository as a plugin.

Decision Outcome

Chosen option: [option 1] move all code to the theme and retire the plugin.

Pros and Cons of the Options

[option 1]

  • Good, because of decreased complexity on code changes that touch both repos (interconnected pull requests)

  • Good, because it would simplify test instances deployments and testing.

  • Good, because it would simplify the code review process if everything is one repository.

  • Good, because it would reduce duplication of code (eg. CI, webpack, linters).

  • Good, because it would simplify tests that touch functionality on both sides.

  • Bad, because it seems to be the WP way having blocks as a plugin.

[option 2]

  • Good, some NROs may not need the blocks. (mitigation: add a feature flag for blocks)

  • Bad, because plugin css code depends on theme (submodule complexity).

  • Bad, because translations are split in two.

Links

ADR-0004
[ADR-0004] Switch to Monorepo
Jira Epic