Skip to content

Latest commit

 

History

History
481 lines (316 loc) · 19.9 KB

CHANGELOG.md

File metadata and controls

481 lines (316 loc) · 19.9 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

[0.30.0] - 2024-12-01

Added

  • New method Wireframe::createDirectories() for adding Wireframe directories in code.

[0.29.2] - 2024-05-30

Fixed

  • PHP 8.2 deprecation errors resulting from dynamic ViewData properties.

[0.29.1] - 2024-03-05

Fixed

  • PHP deprecation warning from passing null to basename().

[0.29.0] - 2024-01-10

Added

  • New PartialView class that extends TemplateFile core class.

Fixed

  • Fixed an issue where rendering page within page did not properly restore the $view API variable to the state it was in before rendering said page.

[0.28.0] - 2024-01-10

Added

  • Page::renderView() now accepts an array of options as second argument, behaving same as Page::render() when passed an array of options.

[0.27.1] - 2023-10-12

Changed

  • Improve compatibility with RepeaterMatrix module by disabling unsupported render hook(s).
  • Improve performance of some file operations by applying GLOB_NOSORT.

[0.27.0] - 2022-09-26

Changed

  • Stash (and later restore) Wireframe class data array when a page is rendered within another page.
  • Include Page object data array in cache key generated by Wireframe::render().

[0.26.2] - 2022-08-31

Fixed

  • Fixed an issue where Wireframe::page() wasn't handling "non-wired" Page objects properly, resulting in a notice.

[0.26.1] - 2022-07-11

Changed

  • Use TracyDebugger::COLOR_NORMAL for Wireframe Tracy Debugger panel icon and help icon fill color.

[0.26.0] - 2022-07-11

Added

  • New method ComponentView::getComponent() for accessing the Component instance from within comnponent view.

Fixed

  • Fixed an issue where calling on() for component did not trigger emitted/queued events as intended.

[0.25.0] - 2022-06-29

Added

  • New method View::renderView() for rendering View with specific view file, without layout.
  • New method Page::renderView() for rendering Page with specific view file, without layout.

Fixed

  • Malformed sprintf statement for exceptions thrown by View::setViewsPath().

[0.24.2] - 2022-04-11

Fixed

  • An issue where rendering pages with non-default view was unintentionally generating cached files if view had been set via Page::setView() or Page::view().

[0.24.1] - 2022-03-14

Added

  • Resources added to paths (in addition to urls) for convenience.

[0.24.0] - 2022-03-08

Added

  • New config setting global_config_paths for defining which Wireframe paths get automatically added to ProcessWire's $config->paths config object.

[0.23.1] - 2022-03-06

Fixed

  • Additional validation rule to prevent relative view namespace root paths.

[0.23.0] - 2022-03-06

Added

  • Support for view namespaces, initially implemented for partial files only. Namespaces are mapped via the view_namespaces config setting to directories within site path, after which files from said directories can be fetched with $partials->get('namespace::partial'), $partials->render('namespace::partial'), or Wireframe::partial('namespace::partial').

[0.22.2] - 2022-03-05

Fixed

  • Issue in Wireframe::partial() where dot was missing from before extension when using ProcessWire's native template extension.

[0.22.1] - 2022-03-01

Fixed

  • Second argument to Partials::get() wasn't applicable unless partial name had at least one slash; this has now been fixed.

[0.22.0] - 2022-03-01

Added

  • New method Partials::get('path/to/partial') for getting a partial with path. If an array is provided as second argument for this method, rendered markup is returned instead of a Partial object.
  • New method Partials::render('path/to/partial', $args) for returning the rendered markup of a Partial object.

[0.21.3] - 2022-02-27

Fixed

  • Fixes and improvements to make it easier to use components (and other Wireframe features) outside the context of Wireframe rendered templates.

[0.21.2] - 2021-09-05

Fixed

  • Second fix for the issue with non-null falsy value handling in View. Fix introduced in 0.21.1 was not fully functional yet.

[0.21.1] - 2021-09-05

Fixed

  • Fixed an issue where non-null but falsy values passed as an arguments value to Wireframe::render() were replaced by null due to View::get() passing control over to View::getFromController().

[0.21.0] - 2021-06-18

Added

  • Hookable method MethodPropsTrait::getMethodPropCacheName(string $name, string $context). Note that when hooking into this method one should refer to the object that implements the trait, such as a specific Controller class.

Changed

  • Include language ID in persistent cache name generated by MethodPropsTrait for cacheable methods.

[0.20.2] - 2021-03-17

Fixed

  • Fixed an issue where View arguments were accidentally overriding arguments provided for partials during rendering.

[0.20.1] - 2021-03-16

Fixed

  • Fixed an issue with Composer package, no code changes to the module.

[0.20.0] - 2021-03-02

Added

  • Support for short-circuiting Page rendering at Controller by returning a string from Controller::render().

Fixed

  • In case a Page was rendered more than once during a single request, there was a chance that it might've had a reference to a stashed Controller object.

[0.19.2] - 2021-01-09

Fixed

  • Fix an issue where rendering subsequent pages within a view placeholder wasn't working properly. This issue was caused by view placeholder optimizations introduced in 0.19.0.

[0.19.1] - 2021-01-07

Changed

  • Various minor updates and additions to the Tracy Debugger panel GUI, Wireframe API, and Wireframe Hooks.

[0.19.0] - 2021-01-03

Added

  • New autoloaded (optional) companion module Wireframe Hooks.
  • Wireframe API debugger for Tracy, currently only available for superusers.
  • New method Partial::getFilename(?string $ext = null, bool $with_ext = true). This is otherwise the same as type juggling a Partial object to string, but provides more customizability via params when called directly.
  • New methods Partials::getPath() and Partials::getFilenames(string $ext = null, bool $with_ext = true).

Changed

  • Wireframe API built-in endpoints now provide more verbose errors if debug mode is enabled or user is logged in as superuser.
  • When rendering view placeholder, skip most of the Wireframe init process. This is an optimization, but also lets us access any values previously set for the View object etc.

Fixed

  • In some cases Wireframe API wasn't able to catch errors; this part should now work more consistently.
  • Enabled endpoints setting in Wireframe API module config now works as expected.

[0.18.3] - 2020-11-30

Fixed

  • Fixed an issue where Wireframe Tracy panel displayed errors if opened on the Admin.

[0.18.2] - 2020-11-28

Fixed

  • PHP 8 requires __set() to either not declare a return type, or declare a void return type. This has been fixed.

[0.18.1] - 2020-11-08

Fixed

  • PHP 7.4 deprecated ReflectionType::__toString(), update MethodPropsTrait to use ReflectionNamedType::getName() instead. Also add support for PHP 8 ReflectionUnionType.

[0.18.0] - 2020-11-08

Added

  • Tracy panel for Wireframe.

[0.17.1] - 2020-10-17

Fixed

  • Fixed an issue where Config class path creation wasn't working properly due to missing Wireframe module instance.

[0.17.0] - 2020-09-20

Added

  • Controller objects have a new method called setPage(), used to set the page property of a specific Controller instance. Additionally this method accepts a boolean that (if set to true) propagates the change to the connected View object as well.

Changed

  • Constructor of Controller class was simplified so that neither argument ($page or $view) is required. If one (or both) of these is left out (or provided with null value), corresponding property will fall back to API variable ($this->wire('page') or $this->wire('view')).
  • Controller base class "view" and "page" properties are now private. Accessing them directly behaves much like before, but is now routed via a setter method (setPage() or setView()). Setting the "page" property directly also updates the page property of the related View instance; this is a shortcut for $this->setPage($page, true).
  • If the page property of the View has been defined, it will override the $page API variable render-time. This behaviour is more consistent than before, where "global" $page was used in some situations, "local" (View) page property in others.

[0.16.0] - 2020-09-14

Added

  • Support for specifying view and view template at the same time with Page::setView('[view template name]/[view name]').

Changed

  • Wireframe module now updates the internal settings hash more consistently. This hash is primarily used for runtime page render caching.

[0.15.2] - 2020-09-13

Changed

  • Specify return type of Config::getPaths() as stdClass instead of object for PHP < 7.2.

[0.15.1] - 2020-09-13

Fixed

  • Fixed an issue where partial files were not rendered properly if a Renderer module was enabled.

[0.15.0] - 2020-09-11

Added

  • Internal stash for storing previous Page, View, and Controller instances in case a Page is rendered within another Page. This way earlier context can be restored once recursive rendering is done, and Wireframe can continue where it left off.

[0.14.0] - 2020-09-06

Added

  • New ComponentView class, as well as the ability for component views to access Component class public methods as properties, in the same way view files and layouts can access Controller class public methods.

Changed

  • Hook related code moved from Wireframe module to separate Hooks class.
  • Accessing public class methods as properties in view files was moved into a new trait called MethodPropsTrait. This trait is used internally by Controller and Component classes.
  • Some minor improvements related to dependency injection within Wireframe objects (and ProcessWire objects instantiated by Wireframe.)

[0.13.2] - 2020-09-02

Fixed

  • An issue where null value passed to Component view or partial never reached the actual view file, resulting in undefined variable notices (and potentially other unexpected issues).

[0.13.1] - 2020-08-31

Fixed

  • Config class getPaths() method had wrong return type specified, rendering module config screen unusable.

[0.13.0] - 2020-08-28

Added

  • New hook makes View properties directly accessible in TemplateFiles (e.g. when rendering field templates)

Changed

  • Wireframe::getController() is now a public method that can return current Controller instance, the Controller instance for provided page, or a Controller instance for provided Page and template name.
  • Visibility of following methods was changed from public to protected: Wireframe::___checkRedirects(), Wireframe::___redirect(), Wireframe::___initView(), Wireframe::___initController(), \Wireframe\Config::getCreateDirectoriesField().
  • Controller class implementation was streamlined: new objects are wired using the native wire() function, and thus Controller constructors no longer require the ProcessWire instance as an argument.
  • Wireframe no longer caches partials unnecessarily, plus new Partial objects are automatically wired.
  • Various minor optimizations, some code cleanup, and a few improvements to comments.

[0.12.0] - 2020-08-24

Added

  • Support for named arguments when using Wireframe::component($component_name, $args).
  • JSON API. See comments in the WireframeAPI module file for more details.
  • New Page methods Page::getController() and Page::setController().
  • Module config screen provides support for creating directories corresponding to configured Wireframe URLs, assuming that they were provided as relative paths.

Changed

  • Wireframe::setView() accepts optional view name as an argument.
  • View::setController() accepts Controller name (string) in addition to Controller class instance or null.
  • When Controller is instantiated, it no longer overrides the Controller property of the related View instance.

Fixed

  • Wireframe::partial() now works as expected for partial names with file ext included (partial_name.php etc.)
  • Wireframe::partial() prevents 2 or more dots in partial name, just in case (directory traversal is not intended).

[0.11.0] - 2020-05-13

Changed

  • Partials class now detects if a missing partial is being requested and throws an exception.

[0.10.2] - 2020-03-13

Fixed

  • When rendering a partial with arguments, prepare the arguments array properly before use.

[0.10.1] - 2020-03-13

Fixed

  • Autoload Factory class in cases where it's methods are called before Wireframe has been initiated.

[0.10.0] - 2020-03-03

Added

  • New class Partials. Container for Partial objects. Provides a gateway for rendering partials with arguments ($partials->name(['arg' => 'val'])).
  • New class Partial. Singular Partial object. Provides the ability to render a partial and adds support for multiple (alternate) file extensions for each partial.
  • New class Factory. This class encapsulates various static factory methods and is accessed through the Wireframe class.
  • New static method Wireframe::partial($partial_name, $args). This method provides a shortcut for rendering partial files.
  • New method Wireframe::setViewTemplate(). This allows overriding current view template via the Wireframe object, primarily intended to be used in the Wireframe bootstrap file.

Changed

  • Shared renderer related features were moved to new trait RendererTrait. This is used internally by View, Component, and Partial classes.

[0.9.1] - 2020-02-03

Fixed

  • An issue where rendering a Page that didn't have an existing template file or altFilename via Wireframe::page() could result in ProcessWire error message.

[0.9.0] - 2020-02-02

Added

  • New EventListenerTrait. Currently used by Components only. Adds support for listening to and emitting events.
  • Support for Renderer modules for adding templating engine support for view files, component view files, etc.
  • New Page methods Page::viewTemplate(), Page::getViewTemplate(), and Page::setViewTemplate().
  • New method Component::getData() for manually defining the data passed to the component view.

Changed

  • Controller::init() and Controller::ready() are now hookable methods.
  • Component::setView() and Component::getView() are now final methods, preventing accidental overrides.
  • Layout file is no longer necessary; if it's missing, the page can be rendered using just a view file.

[0.8.0] - 2020-01-06

Added

  • Support for Components, along with a new static factory method Wireframe::component($component_name, $args).
  • Support for rendering pages that have not been "routed" to Wireframe using the altFilename template setting.
  • New static getter/factory/utility method Wireframe::page($source, $args).
  • New static utility method Wireframe::isInitialized().

Changed

  • Wireframe::$initialized is now a static property. This was a necessary change so that Wireframe::isInitialized() could be implemented effectively.

[0.7.0] - 2019-11-04

Added

  • Runtime caching support for Controller method return values. Values are cached unless the name of the method is found from Controller::$uncacheable_methods.
  • Persistent caching support for Controller method return values. Values are cached only when found from the Controller::$cacheable_methods array.

Changed

  • In the View class all internal requests for Controller properties are routed through View::getFromController().

[0.6.0] - 2019-09-13

Added

  • New Page methods Page::getLayout(), Page::setLayout(), Page::getView(), and Page::setView().
  • New Controller::render() method, executed right before a page is actually rendered.
  • New ViewData class for storing (internal) data required by the View class.
  • New getter/setter methods for ViewData properties for the View class.
  • New method Wireframe::getConfig() for getting current config settings.
  • New method ViewPlaceholders::has() for checking if a placeholder has already been populated.

Changed

  • Various View-related features moved from Wireframe module and ViewPlaceholders class to the View class.
  • Removed access to local get* and set* methods via the PHP's magic setter method __set() and getter method __get() in the View class.
  • Redirect feature no longer fails if provided with a WireArray data type; in these cases the first item is used as the redirect target.
  • Improvements to PHPDoc comments.

Fixed

  • An issue with Config class where the "all directories exist" message was sometimes displayed unintentionally.
  • An issue where View Placeholder values might've been overwritten because existence of earlier value was checked inproperly.
  • An issue where empty / null view file would be automatically replaced with value "default".

[0.5.2] - 2019-08-28

Fixed

  • ViewPlaceholders is provided with a reference to the View object in order to keep template name in sync.

Changed

  • ViewPlaceholders no longer tracks template name separately, and the constructor method no longer accepts template name as an optional param.
  • Comments, property visibilities, and some parameter names in the ViewPlaceholders class updated to match the rest of the codebase.

[0.5.1] - 2019-08-22

Fixed

  • Fix an issue where the redirect feature wasn't working properly when using a Page Reference field.

[0.5.0] - 2019-08-15

Added

  • New internal features for caching and optimizing render times.

Fixed

  • Perform certain initialization tasks only once (attach hooks, configure autoloader, etc.)
  • Fix an issue where another page couldn't be rendered with provided view/layout combination.

[0.4.0] - 2019-07-07

Added

  • Wireframe\Lib namespace was added to ProcessWire's class autoloader.

[0.3.0] - 2019-07-03

Added

  • New Wireframe Config class was added and Wireframe was made configurable.
  • Support for automatically creating Wireframe directories via module config screen in case ProcessWire has necessary write access.

Changed

  • Some refactoring, including changes to method names and return values, for better readability and more consistent API.
  • In Wireframe::init() paths and ext are now set by separate methods, not directly in the init() method itself.

[0.2.1] - 2019-06-30

Changed

  • Bumped required version of wireframe-framework/processwire-composer-installer to 1.0.

[0.2.0] - 2019-06-23

Changed

  • Bulk of the documentation removed from the README file and moved to wireframe-framework.com.
  • The "view" directory was removed and its contents were moved directly under the templates directory.
  • The templates directory was added to the include path, and view directory removed.

[0.1.0] - 2019-06-23

Changed

  • Renamed the module, along with its namespaces, from wireframe to Wireframe.
  • Renamed "view scripts" to "views", while also using the term "view files" where appropriate.

Fixed

  • Corrected site profile URLs in the install instructions in the README file.
  • Improvements and corrections to PHPDoc DocBlocks.

[0.0.16] - 2019-06-22

Changed

  • Updated the required version of wireframe-framework/processwire-composer-installer.

[0.0.15] - 2019-06-17

Added

  • Added $config->urls->dist, by default pointing to /site/assets/dist/.

Changed

  • Renamed default resources (assets) directory from "static" to "resources".
  • Changed recommended image resources directory name from "img" to "images".

[0.0.14] - 2019-06-16

Changed

  • Switched Composer installer from hari/pw-module to wireframe-framework/processwire-composer-installer.

[0.0.13] - 2019-06-02

Added

  • Added .htaccess to protect markdown files from direct access.

Changed

  • Improvements to code comments and some minor refactoring.

Fixed

  • Fixed a minor issue in Controller base class where the _wire property wasn't being set properly.

[0.0.12] - 2019-06-01

Added

  • Added composer.json.

[0.0.11] - 2019-05-27

Fixed

  • Fixed invalid JSON syntax in module info file.

[0.0.10] - 2019-05-23

Added

  • Added CHANGELOG.md.