Comments (6)
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.
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.
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.
@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.
@sverweij Tried it and this works perfectly! Really appreciate the quick turnaround 👍
from dependency-cruiser.
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)
- Issue: numberOfDependentsLessThan does not calculate dependents properly when index.ts is used inbetween HOT 5
- Feature request: Allow to have rules checking Typescript types but also rules that ignore Typescript types HOT 2
- Issue: false positive for couldNotResolve for type only package HOT 5
- Question: A dependency view of each "TYPE" or "INTERFACE" HOT 3
- Question: monorepo, combinedDependencies & not-dev-dep HOT 2
- Error: No "exports" main defined in <project_name>/node_modules/dependency-cruiser/package.json HOT 3
- What am I missing about rcdot? "'rcdot' is not a valid output type" HOT 2
- Issue: not-to-unresolvable return error when using typescript alias in module project HOT 2
- Why doesn't dependency-cruiser "ignore" my private-registry package like it does with node-modules? HOT 6
- Q: Dep Graph for each file HOT 3
- Feature request: consider symlinked workspaces HOT 5
- Issue: not-to-spec and not-to-dev-dep default config should include tsx and jsx HOT 3
- Issue: using `workspace:` to implement nohoist in a package.json while using pnpm throws an error HOT 4
- Missing mermaid example HOT 1
- Feature request: reporters might report `comment` of rules other than `forbidden` HOT 3
- Issue: cruise API - breaking changes HOT 4
- Question: Resolving typescript source files imported from outside specified package HOT 2
- Question: dependency-cruiser API gives a different result when `baseDir` is changed HOT 6
- Question: Can I access the classes/methods/functions in modules? HOT 4
- Listing dependancy tree via dependency-cruiser gives me the reference from barel files HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dependency-cruiser.