AmphiBee / pollen-framework

:closed_book: Laravel & WordPress blend for coding as sweet as honey. Join the hive! https://github.com/AmphiBee/pollen-framework
https://amphibee.fr
Other
5 stars 0 forks source link

Implement Asset Facade for Managing Frontend and Backend Styles and JavaScript #14

Closed ogorzalka closed 1 year ago

ogorzalka commented 1 year ago

This ticket aims to implement an “Asset” facade that will streamline the injection of CSS stylesheets and JavaScript resources on various parts of the website, including the frontend, backend, WordPress login page, and the WordPress content editor. The facade will allow developers to easily manage asset injection using WordPress’s built-in functions, with the added flexibility of specifying injection location (head or footer) and leveraging ViteJS integration if desired.

Tasks:

  1. Develop the “Asset” facade, including methods for injecting CSS and JavaScript resources into specific parts of the website.
  2. Implement methods for specifying injection location (head or footer) when injecting CSS or JavaScript resources.
  3. Integrate the Laravel Vite facade to allow for the injection of assets managed by ViteJS if the “useVite” method is called.
  4. Create logic within the “Asset” facade to appropriately generate the necessary WordPress functions for asset injection based on provided parameters.
  5. Test the “Asset” facade with various scenarios, including frontend, backend, WordPress login page, and content editor injections.
  6. Ensure compatibility and proper functioning of the “Asset” facade when used in conjunction with ViteJS integration (Blade directive here: https://github.com/laravel/framework/blob/256f4974a09e24170ceeeb9e573651fd5e1c703e/src/Illuminate/View/Compilers/Concerns/CompilesHelpers.php#L58)
  7. Update the documentation to provide detailed instructions on how to use the “Asset” facade for managing asset injection and ViteJS integration.

Expected Outcome: Upon completion of this ticket, the “Asset” facade will be successfully implemented, allowing developers to manage the injection of CSS stylesheets and JavaScript resources across different parts of the website. The facade will support specifying injection location and enable seamless integration with ViteJS, leveraging the Vite facade provided by Laravel. This implementation will enhance developers’ ability to manage assets effectively, providing more control over frontend and backend styles and JavaScript resources.

ogorzalka commented 1 year ago

Added with feature/assets branche

Documentation here : https://github.com/AmphiBee/pollen-documentation/blob/main/assets.md