Coder Social home page Coder Social logo

Comments (4)

KentonWhite avatar KentonWhite commented on August 11, 2024

HI @eribul, this is an interesting thought. In the global.dcf there are 2 cache flags: cache_loading and cache_loaded_data. I'm assuming for this conversation you are referring to cache_loading and that if cache_loading is set to FALSE you aren't using the cache directory. I'm also assuming that you have manually removed the cache directory. If I'm missing something please let me know!

ProjectTemplate is meant as a framework that provides sensible defaults. This sets novices on a good path, which includes caching data for faster load time. At the same time, ProjectTemplate shouldn't get in the way of experienced users. If you don't want a cache folder you should not need a cache folder!

It's an easy change making cache not mandatory. What should ProjectTemplate do if a person has removed the cache directory and then decides they want caching? Should it simply fail, putting the burden on you to figure out what went wrong? Should it provide an error message that a cache directory should be present and require you to make the cache directory? Should it create the cache directory, notify the user, and get on with the work?

Before making the change, these are the questions I'm mulling over. Would love your thoughts! I'm leaning towards creating the directory if this wouldn't get in your way.

from projecttemplate.

eribul avatar eribul commented on August 11, 2024

Hi agin!
Yes, I had removed it manually for a project without any data of its own (usnig data from SQL database and just exporting a report).
I agree! To create the cahce folder with a message sounds great :-)

from projecttemplate.

KentonWhite avatar KentonWhite commented on August 11, 2024

Hi @eribul,

I've been checking edge cases associated with removing the cache directory. Not having a cache directory may interfere with other features. Caching is very much integrated with ProjectTemplate going forward. I also recognize that sometimes the cache directory is removed! The error message coming from .stopifnotproject could be very confusing if the cache directory is missing. It simply says "<current_directory> is not a ProjectTemplate directory." This is not very informative and can lead someone down a very frustrating path if the cache directory or the data directory is missing.

Rather than catching all the places where the cache could be used, checking for the cache directory, and creating a cache directory if missing, I think the way forward is providing a more informative error message. I'm adding to the existing error message the following: "If you believe you are in a ProjectTemplate directory and seeing this message in error, try running migrate.project(). migrate.project() will ensure the ProjectTemplate structure is consistent with your version of ProjectTemplate."

from projecttemplate.

eribul avatar eribul commented on August 11, 2024

Sounds great! I agree!

from projecttemplate.

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.