Giter Club home page Giter Club logo

Comments (9)

BryanCrotaz avatar BryanCrotaz commented on June 16, 2024

Simplest possible BrocFile:

var archiver = require('broccoli-archiver');

module.exports = new archiver("src");

This shows broccoli-archiver's build method being called every time even when no source files have changed.

from broccoli-caching-writer.

BryanCrotaz avatar BryanCrotaz commented on June 16, 2024

@joliss is this something you can comment on? Feels like I've built a very simple plugin but I can't for the life of me work out how to enable caching

from broccoli-caching-writer.

BryanCrotaz avatar BryanCrotaz commented on June 16, 2024

for avoidance of doubt I'm running with broccoli-clext
broccoli-clext build dist --once

from broccoli-caching-writer.

BryanCrotaz avatar BryanCrotaz commented on June 16, 2024

Seems like caching only works if you leave broccoli running but if you run broccoli twice the cache doesn't work - build gets called twice.

broccolijs/broccoli-plugin#11

from broccoli-caching-writer.

stefanpenner avatar stefanpenner commented on June 16, 2024

Seems like caching only works if you leave broccoli running but if you run broccoli twice the cache doesn't work - build gets called twice.

this is by design. broccoli-persistent-filter does have a second level of caching, which allows it to persist beyond the life of the process. But it is very tricky to get the cache keys just right, and with persistent-filter the inputs aren't opaque but with this tool... they are quite tricky.

Persistent-filter largely works as expected, but it is still quite riddled with caveats and some bugs that must be fixed.

TL;DR that sort of caching, done without issue will most likely (for now anyways) be a one-off solution for the specific use-case.

It is possible to solve this problem, but deriving the appropriate cache key is surprisingly quite difficult, especially in the general case.

from broccoli-caching-writer.

BryanCrotaz avatar BryanCrotaz commented on June 16, 2024

Where are the caveats documented?

from broccoli-caching-writer.

stefanpenner avatar stefanpenner commented on June 16, 2024

@BryanCrotaz typical cache key problems, if something isn't included in the cache key, and it alone changes you will have a stale build.

from broccoli-caching-writer.

BryanCrotaz avatar BryanCrotaz commented on June 16, 2024

What needs to go in the cache key other than the last modified of the source files?

from broccoli-caching-writer.

stefanpenner avatar stefanpenner commented on June 16, 2024

@BryanCrotaz what other information may change between restarts?

The source-code that is being executed (and their dependent files), the node version, the OS, the ENV vars etc.etc.

from broccoli-caching-writer.

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.