Git Product home page Git Product logo

Comments (6)

tinchoz49 avatar tinchoz49 commented on June 15, 2024 4

@thisconnect i release a new version with the fix 🎉 . Please, can you check if this change solves your problem?

from postcss-copy.

tinchoz49 avatar tinchoz49 commented on June 15, 2024 1

Hi again,

  1. Yes, this is correct, postcss-copy only reads the file 1 time. We use this to avoid read the file from the src multiple times but the transform is executed in each occurrence of the file.

  2. I understand what you are saying about the rare case but I think execute the transform in each occurrence it makes not sense because in the next step (writing the file) if the content doesn't change d we use the content cached so the transform processing was waste of time.

This a bug...the transform process has to be called only when the source is modified.

from postcss-copy.

thisconnect avatar thisconnect commented on June 15, 2024

Thanks! That works for me. I noticed that you pass query, qparams, qhash in fileMeta

If you test

span {
    background: url('images/bigimage.jpg?A#A');
}

div {
    background: url('images/bigimage.jpg?B#B');
}

It would only report one (the first?) of them.

Chaning tranform on a filebase would not be 100% backwards compatible as some people may do different optimization depending on the querystrnig/hash.. altough that might be a rare case.

Not sure how this should be handled correctly. But it's no problem for me.

from postcss-copy.

thisconnect avatar thisconnect commented on June 15, 2024

Since transform is/should be on a per file base, I think query, qparams and qhash does not make sense and should be removed from fileMeta. Changing to filebased transform is a breaking change and needs major semver upgrade IMO.

from postcss-copy.

tinchoz49 avatar tinchoz49 commented on June 15, 2024

Hi @thisconnect !

The fileMeta is an object with all kind of information of the file. I prefer keep the structure in all the copy process.

Chaning tranform on a filebase would not be 100% backwards compatible as some people may do different optimization depending on the querystrnig/hash.. altough that might be a rare case.

Yes at the begin I thought the same, but then i saw the code and i realized that in the old version even if the transform process had been called more than once per file the write process is called only one ( when the file doesn't exist or is modified).
So if some user in the past have tryed to use the transform process with different optimizations depending of the fileMeta it never going to work 😄 because the "issue" in the transform process.
So in my opinion it's not a breaking change, it's kind a bug and a feature that can be defined as a minor semver upgrade.

What do you think?

from postcss-copy.

thisconnect avatar thisconnect commented on June 15, 2024

Good to know, yes that makes sense. All good then and thanks again for your quick reply and fixed version!!

from postcss-copy.

Related Issues (20)

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.