Code Monkey home page Code Monkey logo

Comments (6)

ajafff avatar ajafff commented on July 28, 2024

So you are using the API, right? There are some global caches in there that are never cleared unless you start a new process.
AFAICT it'd be a fairly large refactoring correctly clear those caches.

from dependency-cruiser.

wongjasont avatar wongjasont commented on July 28, 2024

You are correct I am using the API. It seems to be that way. Any workaround to force it to not use the cache you mentioned? Perhaps one of the keys in options?

Restarting the process again will be a solution yes but it defeats the purpose of the optimization tool i am building. Any suggestion is appreciated.

Thanks

from dependency-cruiser.

sverweij avatar sverweij commented on July 28, 2024

Hi @wongjasont interesting use case :-)

It's as @ajafff says - dependency-cruiser caches a lot to be performant. That said, the situation is not as dire as implied above :-) - dependency-cruiser has more situations which need cache busting (unit & integration tests for instance).

  • Caching is implemented with memoization over the function that does the actual work. In a most cases the unmemoized function is available already - just not exposed in the API. It'll be some work to expose that in the API, but I expect it to be straightforward.
  • The (webpack enhanced-resolve) has its own caching mechanism - but I've implemented a bustTheCache resolve option to be able to do exactly that.

(OTOH implementing a cache invalidation mechanism that only invalidates that which is strictly necessary will indeed be harder...)

from dependency-cruiser.

sverweij avatar sverweij commented on July 28, 2024

@wongjasont version [email protected] should solve this issue - could you give it a spin?

(I've made a first implementation of cache invalidation that should work in your use case - it was easier to cook than expected 😍 @ lodash).

from dependency-cruiser.

wongjasont avatar wongjasont commented on July 28, 2024

@sverweij Tried it and this works perfectly! Really appreciate the quick turnaround 👍

from dependency-cruiser.

sverweij avatar sverweij commented on July 28, 2024

Hi @wongjasont - I've published 4.18.0 as a regular version on npm. It contains the resolution for this issue you tested earlier. A.c.t. the version you tested I found I missed a a cache clean call to the (webpack enhanced-resolve cached filesystem) resolver. 4.18.0 contains the fix for that as well (details in PR #129).

from dependency-cruiser.

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.