https://github.com/wintercms/winter/pull/552 introduced a change where all backend assets are converted to URLs to provide support for the `app.asset_url` configuration variable. This change allows asset decompilation to still work by converting a (local) URL back to a relative path. If a URL doesn't match the root URL, then it is passed through as is with no decompilation taking place.
Fixes https://github.com/wintercms/winter/issues/562.
Commands like php8.1 composer.phar install resulted in a successful installation but failed during the execution of the "post-update-cmd"-Script.
`@php` should fix this (and did it on my environment), according to:
https://getcomposer.org/doc/articles/scripts.md#executing-php-scripts
Previously, Snowboard plugins had been written to append the main JavaScript constructor. While this worked, it prevented the ability to destruct the plugin during construction (ie. prevent double initialisation on plugins, for example), as the "detach" method which is fired on destruction is added *after* construction.
This change abstracts the constructor and destructor to separate methods run after the true construction of the JavaScript object is complete. A bonus is that the constructor no longer needs to include "snowboard" as one of the parameters - this instead is done on the true construction.
This matches the previous behavior from the old framework, and resolves some issues with race conditions. It's not great - but it works for now, until we can have some true dependency resolution with the assets.
This PR establishes a base Snowboard framework in the Backend. While we won't likely have any specific Snowboard widgets or functionality in the 1.1 branch, it will allow people to use Snowboard in the Backend should they wish.
Fixes#541.
Co-authored-by: Luke Towers <github@luketowers.ca>
This should fix https://github.com/wintercms/winter/issues/177, but it will cause all existing installations to resize all of their already resized images.
Another alternative could have been to include the hash of the source image; but it would have been at the expense of more work every time this function is called, which could potentially include generating hashes of multiple extremely large (10+ MB) images on every page load if the page includes such images that need to be resized since the filter needs to identify the configuration in order to identify the path to the resized image to check if it needs to return a resizer/ URL or a /resized one.
Further improvements could potentially be made in the isResized()
Also separated the global base styles for icons with the actual icon list, so we can limit the icons loaded (ie. for the standard exception / error views)
When the package is not present in package.json, the correct error is not thrown because $packagePath not exists.
Co-authored-by: Luke Towers <github@luketowers.ca>