Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vercel/nft
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.22.5
Choose a base ref
...
head repository: vercel/nft
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.22.6
Choose a head ref
  • 3 commits
  • 5 files changed
  • 3 contributors

Commits on Dec 6, 2022

  1. Configuration menu
    Copy the full SHA
    4949d8e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    047f030 View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2022

  1. fix: Make caching work correctly in async context (#320)

    Right now the cache was only populated after the call to the fs API
    succeed, which in an async context was leading to multiple file IO or
    analyze tasks started for the same file at once. This is because both
    file IO are async and so until the fs call finished other calls for the
    same file can still come in.
    
    To fix this I extracted all file IO calls into a separate class that
    wraps everything correctly and instead of caching the actual result, now
    a Promise is cached. So the cache now always needs to be awaited.
    
    As the values in the cache change this is definitely a breaking change.
    Something like this:
    
    ```diff
    const cache = {};
    await nodeFileTrace([file], {
        cache,
    );
    
    -const cacheValue = cache.fileCache.get(file);
    +const cacheValue = await cache.fileCache.get(file);
    ```
    
    I know this is quite a big change, just let me know what you think and
    if I should change anything. :)
    
    In my personal example the number of calls to analyze went from ~2400 to
    ~1600 and the runtime from ~3s to ~2.7s (which includes other work than
    nft)
    
    Co-authored-by: Steven <steven@ceriously.com>
    danez and styfle authored Dec 14, 2022
    Configuration menu
    Copy the full SHA
    1a7f083 View commit details
    Browse the repository at this point in the history
Loading