Giter Site home page Giter Site logo

dorsetdigital / silverstripe-enhanced-requirements Goto Github PK

View Code? Open in Web Editor NEW
10.0 4.0 4.0 19 KB

Extends and enhances the Silverstripe requirements system, providing inlining of assets, http/2 server push, deferred css, etc.

License: BSD 3-Clause "New" or "Revised" License

PHP 100.00%
silverstripe silverstripe-4 silverstripe-module frontend http2-push preload cwv performance

silverstripe-enhanced-requirements's People

Contributors

dorsetdigital avatar jamesbbp avatar xini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

silverstripe-enhanced-requirements's Issues

Add option to combine inlined assets

Currently, all inlined assets get added to the page in their own <style> and <script> tags. It would be nice if they could be combined, so that all the CSS which has been inlined and all the JS which has been inlined are injected into a single tag.

This should be a configurable option, and separated out for CSS and JS... not least of all because it relies on people adding all the right semi-colons, etc. to their scripts to make sure things don't break!

Exception class namespaces missing

In the themedCSS() and themedJavascript() methods, when a file is not present, an InvalidArgumentException is thrown.
There's a missing 'use' statement in the custom backend class, which means that when this happens, a not found error is thrown instead of the expected method:

'[Emergency] Uncaught Error: Class 'DorsetDigital\EnhancedRequirements\View\InvalidArgumentException' not found'

Adding use InvalidArgumentException; should sort it

theme methods not working

The themedCSS and themedJavascript methods don't currently accept the third parameter.
The signature of these methods in the Requirements doesn't include the parameters to be able to pass to the backend.

Need to use injector to replace Requirements with an extended version to allow for the method signatures to be changed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.