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

2.x Roadmap/Todos #82

Closed
44 tasks done
tbreuss opened this issue Nov 9, 2022 · 2 comments
Closed
44 tasks done

2.x Roadmap/Todos #82

tbreuss opened this issue Nov 9, 2022 · 2 comments
Assignees
Labels

Comments

@tbreuss
Copy link
Member

tbreuss commented Nov 9, 2022

Todo list for the upcoming 2.x release.

Nice-to-have

  • Implement PSR-14 Event Dispatcher https://www.php-fig.org/psr/psr-14/
  • Add aliases to system info twig function
  • Rename example folder to website
  • Rename src folder to system
  • Rename sysplugins folder to plugins
  • LowerCamelCase member vars in Page class. This is already done, since all of this is possible: page.content_type, page.contentType, page.getContentType()
  • Consistent naming for methods (applications instead of app, eventFilters for events, etc.)
  • Integrate GitHub atom feed into the homepage of the website
  • Implement a query builder class for filtering, sorting und limiting of iterable data structures
  • Add readme to all system plugins (https://github.com/getherbie/herbie/tree/2.x/plugins)

Suggestions

  • Group twig filters, functions and tests logically to make it more clear for the user (i.e. nav_sitemap, nav_breadcrumb, etc.)
  • Replace InterceptingFilters with PSR14- EventListeners, because the latter are strongly typed
  • Remove PageItem and use Page only. Lazy load content and segments.
  • Replace access via magic getters with real getters (we have it already), since the latter is faster and more explicit.
  • Add timestamp to css and js assets to force browsers to refresh cached css and js files
  • Reformat whole code base within Phpstrom according PSR-12 definitions (and defaults)
  • Add support for PHP 8.2
  • Drop support for PHP 7.4 (end-of-life)
  • camelCase all page properties Reason: recommended coding convention for twig is snake_case
  • camelCase all twig filter, functions and globals including attributes Reason: recommended coding convention for twig is snake_case

Issues

  • Add parent IDs to page and pageItem
  • Add parent route to page and pageItem
  • Plugin simplecontact: Success page after sending form doesn't work (index.php/contact:success), make it 2.x compatible, update readme.md
  • Plugin simplesearch: Make it 2.x compatible, update readme.md
  • Slightly refactor Event Handler and send any class to listener
  • Consistent handling for Twig globals as for filters, functions, and tests
  • Whitelist classes to be injected into plugin
  • Move twig "body_class" function from "twig plus" to "twig core" plugin and rename it to "css_classes"
  • Move twig "snippet" function from "twig_plus" to "twig_core" plugin
  • Move twig "page_title" function from "twig_plus" to "twig_core" plugin
  • Group menu twig functions to make it more clear for the user (i.e. menu_sitemap, menu_breadcrumb, etc.)
  • Rename twig "filter" filter due to a naming conflict with twig's own "filter" filter
  • Remove twig filters, functions and tests from "twig_plus" plugin that are not generic like pages_filtered() or pages_recent()
  • Rename "link_file" twig function to "link_media"
  • Rename "file" twig function to "link_file" (the above must be done first)
  • Remove \herbie\TwigFilter, \herbie\TwigFunction, and \herbie\TwigTest
  • Remove unused methods in \herbie\PageList, since we have the query method now
  • Rename event folder to events
  • Rename herbie\sysplugin namespace to herbie\sysplugins
  • Rename tests namespace to herbie\tests
  • Move commands into commands folder
  • Move middlewares into middlewares folder
  • Enhance pagination class with proper members, methods and the narrowed list of items, etc.
  • Use query builder in "menu_list" twig function
  • Implement pagination in query builder, see https://herbie.tebe.ch/doc/indepth/query-builder#paginate

Not necessary

  • Update ServerRequest in Container with current Request including needed arguments like route, routeParams or page Route with params can be retrieved by UrlManager

Won't fix or unsolvable

  • robots.txt doesn't work with internal PHP server (example link http://localhost:9999/robots.txt). Reason: Seems to be an issue with the PHP web server itself.
  • sitemap.xml doesn't work with internal php server (example link http://localhost:9999/sitemap.xml). Reason: Seems to be an issue with the PHP web server itself.
  • Prefix all twig filters, functions and tests with herbie_, h_ or similar (to prevent naming conflicts and better distinguish twig-owned filters, functions and tests). Reason: Makes filters, function or tests too clumsy.
  • Evaluate and include illuminate collections in twig templates. Reason: Collections are indeed very useful, but in Twig not as practical as thought.
@tbreuss tbreuss self-assigned this Nov 9, 2022
@tbreuss tbreuss added the 2.x label Nov 9, 2022
@tbreuss tbreuss changed the title 2.x Roadmap 2.x Issues Nov 12, 2022
@tbreuss tbreuss changed the title 2.x Issues 2.x Todos Nov 12, 2022
@tbreuss
Copy link
Member Author

tbreuss commented Nov 12, 2022

Possible solution for building a tree from a list. The tree could then be wrapped in a iterable class and handled with the several SPL iterator classes.

function buildTree(array $items)
{
    $tree = [];

    /* Initialize a reference array */
    $references = [];
    foreach ($items as &$node) {

        // Add the node to our associative array using it's ID as key
        $references[$node['id']] = &$node;

        // Add empty placeholder for children
        $node['children'] = [];

        // It it's a root node, we add it directly to the tree
        if (empty($node['parent_id'])) {

            $tree[$node['id']] = &$node;

        } else {

            // It was not a root node, add this node as a reference in the parent.
            $references[$node['parent_id']]['children'][$node['id']] = &$node;

        }
    }

    return $tree;
}

@tbreuss tbreuss changed the title 2.x Todos 2.x Roadmap/Todos Dec 8, 2022
@tbreuss
Copy link
Member Author

tbreuss commented Jan 2, 2023

Version 2.0.0 just released.

@tbreuss tbreuss closed this as completed Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant