Giter Site home page Giter Site logo

codeigniter4-assets's People

Contributors

craigrodway avatar dependabot[bot] avatar jozefrebjak avatar mgatner avatar neznaika0 avatar rodolfodn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

codeigniter4-assets's Issues

disable dynamic parameter .js?v=1599757859

is it possible to disable dynamic generation of parameters for js and css files?
because it does not allow the file debugger.
name_file.js?v=1599757859
only name_file.js
I could not understand if it is generated by codeigniter or by this library.
I apologize if it's off the subject.

Feature: Asset Groups

Define assets groups that can be assigned to routes or loaded on-the-fly and include required files for a given module (e.g. "ChartJS" would include both the JS and CSS files)

Feature: Toolbar Collector

Handy for troubleshooting would a Toolbar Collector with either:

  1. The RouteCollection assets for the current route
  2. The actual assets injected by the filter

Feature: After filter

Add an optional Filter to inject tags automatically instead of having to call the service in every layout template

vendor js loaded after route assets

<script src="http://localhost:8080/assets/footer.js?v=1575209932" type="text/javascript"></script> <script src="http://localhost:8080/assets/test/test.js?v=1575210266" type="text/javascript"></script> <script src="http://localhost:8080/assets/vendor/jquery/jquery.min.js?v=1575151520" type="text/javascript"></script> <script src="http://localhost:8080/assets/vendor/bootstrap/bootstrap.bundle.min.js?v=1575151520" type="text/javascript"></script>

image

config Assets.php for jquery e other

Good Morning,
I configured the library as described in the readme file.
I ran the command
php spark assets: publish
in the project root as indicated.
He made me folders
public / assets / vendor
bootstrap
jquery
dropzone
the question?
how should I configure the app / config / assets.php file
I don't understand the references to the files.
for bootstrap they are bootstrap / dist /
for jquery?
Thanks

AssetsTestTrait::$published

PHPUnit uses a fresh class instance on every run, so modifying $this->published is useless. This needs to be reworked as a static property, probably private but maybe protected?

Issue: Outputted URIs contain \ backslash on Windows

Hi!

Given the code:

<?= \Tatter\Assets\Asset::createFromPath('main.css') ?>
<?= \Tatter\Assets\Asset::createFromPath('main.js') ?>

It now produces:

<link href="http://example.com/assets\main.css?v=1644518679" rel="stylesheet" type="text/css" />
<script src="http://example.com/assets\main.js?v=1644518679" type="text/javascript"></script>

While it does seem to work, and browsers are very forgiving, it's not correct.

I think the issue is here: https://github.com/tattersoftware/codeigniter4-assets/blob/develop/src/Asset.php#L57

self::$config->uri       = rtrim(self::$config->uri, '/\\') . DIRECTORY_SEPARATOR;

This line should probably revert back to a simple '/' value instead of DIRECTORY_SEPARATOR.

Discussion: Patches

Consider merging the "publish" functionality of Manifests with Tatter\Patches.

Bug: Duplicate manifest publishing

Currently manifests from every namespace will publish - this causes a lot of duplicates (Bootstrap.json anyone?). Manifests->publish() should track hashes of each file published and skip dupes.

Fix: Filters Registrar

Instead of using the Filters.php solution to register an alias this library should use Registrar (compare to Shield).

Discussion: Route integration

Would it be easier to apply Assets directly to the routes via app/Config/Routes, similar to how Filters are handled (as Route input)? Or move entirely to Filters with asset groups as input?

$routes->add('reports/chart', ['filter' => 'assets:chartjs,jquery,bootstrap']);

loading single js per page

Good morning,
I would need to upload single js files to a specific page, but after loading the main js files.
example:
general for each page
<? = service ('assets') -> js ()?>
in assets.php does not include chart.js
single only for one page
<? = service ('assets') -> tag ('vendor / chartjs / chart.js')?>
this is possible?

JS and CSS HTTPS

I am using the library in a new project.
I set https for security but scripts and css are always loaded from http not https.
"php": "^7.3||^8.0",
"codeigniter4/framework": "^4.1.5",
"codeigniter4/translations": "^4.1",
"components/bootstrap-default": "^3.3",
"tatter/assets": "^2.3",

My File in app/Config/

app.php

public $baseURL = 'https://mysite.loc'

Assets.php

public $webBase = 'https://mysite.loc'

error:

Mixed Content: The page at 'https://mysite.loc/index.php?debug=true&XDEBUG_SESSION_START=netbeans-xdebug' was loaded over HTTPS, but requested an insecure script 'http://mysite.loc.loc/?debugbar'. This request has been blocked; the content must be served over HTTPS.

Mixed Content: The page at 'https://mysite.loc/index.php?debug=true&XDEBUG_SESSION_START=netbeans-xdebug' was loaded over HTTPS, but requested an insecure script 'http://mysite.loc/assets/js/caricamento.js?v=1639567566'. This request has been blocked; the content must be served over HTTPS.

I don't know if it's an apache2 configuration problem or if Assets is misconfigured if I need to enable a flag ssl = true

Bug: Namespaced routes not matching

In src/Assets.php the controller is determined by stripping $routes->getDefaultNamespace() from $router->controllerName(), but this only works for the default namespace. Need to find a way to strip the namespace of the current controller instead.
Example:
Controller \Tatter\Files\Controllers\Files looks in assets/tatter/files/controllers/files

Configure routes dynamically

Awesome work on this project!

So forgive my lack of understanding on this service library, but I was just wondering if it is possible to configure this dynamically.

The reason I ask is that I would like to use some logic to build the $routes property.

Problem with Upgrade to v3

Hi @MGatner ,

I'm trying to upgrade to v3. I already changed service behaviour to filter, but I have a problem with publishers.

I'm tried to setup own publisher but I got an error like:

/app/vendor/almasaeed2010/adminlte/dist/js/adminlte.min.js fails the following restriction for /app/public/: #\.(?css|js|map|htm?|xml|json|webmanifest|tff|eot|woff?|gif|jpe?g|tiff?|png|webp|bmp|ico|svg)$#i```

then I tried to use your Frontend library and it's same. Can you help me what I'm doing wrong.

I'm running dev in docker.

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.