Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Panel package #6955

Draft
wants to merge 18 commits into
base: v5/develop
Choose a base branch
from
Draft

Conversation

distantnative
Copy link
Member

Description

Certainly a PR with a lower priority

Summary of changes

  • Moved some classes into sub-namespaces, e.g. the dialog classes to Panel\Ui\Dialogs\
  • Refactored many classes to be less static, especially the Panel\Panel and Panel\View classes
  • Moved functionality in dedicated classes
    • Panel\Areas for the logic around gathering and resolving area definitions
    • Panel\Fiber handles all of the Fiber data wrangling incl. globals
    • Panel\Access took over the firewall part (mainly just to have that in one place that's not making Panel\Panel larger)
    • Panel\Router takes care of the routing and general response for the Panel
  • Removed the $ key prefixes
  • New $kirby->panel() that returns the Panel\Panel object

Reasoning

The labyrinth of static method calls was just so hard to parse and some classes (Panel and View) were getting way to big

I also wanted to get a way to access much of this via the $kirby class. So I needed to start a non-static chain of objects.

Additional context

Are there ways to make this easier to review?

Changelog

Fixes

Breaking changes

  • Fiber data: keys aren't prefixed anymore with $. This also affects Panel plugins reloading the Panel by defining only specific keys to be reloaded.
  • Many Panel package classes are now non-static. If you are using them in your code directly, you'll need to update your call signatures.

Ready?

  • In-code documentation (wherever needed)
  • Unit tests for fixed bug/feature
  • Tests and CI checks all pass

For review team

  • Add changes & docs to release notes draft in Notion

@distantnative distantnative self-assigned this Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant