sitecrafting / conifer

:evergreen_tree: A powerful WordPress library plugin for OO development
https://www.coniferplug.in
MIT License
18 stars 2 forks source link

Issue #105 support different asset cache busting #111

Closed kfoubert closed 4 years ago

kfoubert commented 5 years ago

Ticket: # Cache busting

Issue

As a Conifer user, when registering/enqueuing scripts or styles I want to be able to specify my own cache-busting mechanism or file, instead of using the hard-coded assets.version file path.

Solution

Impact

Minimal. Custom version numbers are cached to the $this->asset_version property. Converted this from a string to an array.

Usage Changes

$version can be an array.

  $this->enqueue_style(
    $handle  = 'custom-style',
    $src     = 'custom-style.css',
    $deps    = [],
    $version = ['file' => 'custom-style.version'],
    $footer  = true
    );
});

Testing

No tests written. Errors with lando sniff and lando unit

kfoubert commented 5 years ago

Hi @acobster. I'm stuck on the newer version of Lando. Were you planning on updating the lando yaml file for this project?

acobster commented 5 years ago

@kfoubert yes, but in the meantime you should be able to run the composer sub-commands directly, assuming you have composer installed locally. Look in the Landofile to see what those tooling commands actually run, I think it's just composer sniff-fix.

acobster commented 5 years ago

@kfoubert alternatively, I'd greatly appreciate it if you were able to tackle #103 yourself. I think you could do it pretty easily!

kfoubert commented 4 years ago

@acobster

I got my local repo working with an updated .lando.yml file. This allowed me to run sniff-fix. I ran the unit test and no errors were thrown.

NOTE: I didn't commit my new .lando.yml file, I'll create a separate branch for #103

Please take a look.