ember-cli / broccoli-asset-rev

Broccoli plugin to add fingerprint checksums and CDN URLs to your assets
MIT License
87 stars 84 forks source link

Switch to using broccoli-persistent-filter #93

Open elucid opened 8 years ago

elucid commented 8 years ago

See #92

This updates broccoli-asset-rev to use broccoli-persistent-filter. Although the APIs are similar, it was not possible to do a simple swap-out replacement. In particular, the previous implementation relied on getDestFilePath() not being called for certain relativePaths for which it is now being called. While this could have been worked around, we opted to refactor a bit and use more of broccoli-persistent-filter's public API. The hashing is now done within processString() which is passed in each file's contents so we now avoid an extra readFileSync for every file.

I should explain all of the text fixture renames: hashing the contents parameter of processString() results in different digests for the binary files in the test fixture directories (previously we were hashing a Buffer and now a string).

codecov-io commented 8 years ago

Current coverage is 93.37%

Merging #93 into master will decrease coverage by -2.02% as of 3f51d43

@@            master     #93   diff @@
======================================
  Files            3       3       
  Stmts          152     151     -1
  Branches        36      38     +2
  Methods          0       0       
======================================
- Hit            145     141     -4
  Partial          2       2       
- Missed           5       8     +3

Review entire Coverage Diff as of 3f51d43

Powered by Codecov. Updated on successful CI builds.

rickharrison commented 8 years ago

@stefanpenner Would you mind reviewing and signing off?

stefanpenner commented 8 years ago

Will do

stefanpenner commented 8 years ago

Just tried this and the new broccoli-asset-rewrite PR, unfortunately they don't appear to work correctly.

When used together, it appears broccoli-asset-rewrite seems to prevent assets on disk from getting the correct fingerprinted name, removing it and all appears well.

The issue might be in the other project, but requires a deeper look.

qm3ster commented 8 years ago

Is this PR dead? I want to add pluggable getDestFilePath but it would obviously clash with the change to processString(), so I'd like to know if this is happening.

mirague commented 6 years ago

@stefanpenner @elucid @rickharrison I too wonder about the status of this PR/repository. This particular PR is 14 months old now. How's the support?