Code Monkey home page Code Monkey logo

Comments (6)

MGatner avatar MGatner commented on September 3, 2024

Automated discovery has to balance thoroughness with efficiency. A serious project implementing Schemas will likely want to provide explicit definitions instead of relying on the discovery, but the truth is that most projects will not, nor will they pre-cache, so we have to keep the discovery efficient. I think a full filesystem scan could definitely catch more, but it will be costly.

It might be a good addition as a CLI argument or something, where we could guarantee the full load was only happening in a setting where some user was waiting for a response.

from codeigniter4-schemas.

sfadschm avatar sfadschm commented on September 3, 2024

You're right, the goal should be explicit definitions eventually, but thats not gonna happen for everyone.
For me, I've turned off automatic drafting totally and set the cache lifetime of the schema to never expire, as I don't really see any use in having it autoamtically redrafted every x hours or so, except that drafting might fail for some reason at sometime and crash the whole site. Therefore I only redraft the schema from a specific controller manually, by cleaning schemas chache beforehand.
However, with the potential new model drafter using Factories, autodiscovery might become a completely different topic anyways :)

from codeigniter4-schemas.

MGatner avatar MGatner commented on September 3, 2024

I think that's a brilliant way to do it. I would probably do it via Commands myself but more of a person preference.

I also added migrate triggers to the framework a little while ago, so at some point I will probably add a listeners option to this repo to auto-regenerate.

from codeigniter4-schemas.

sfadschm avatar sfadschm commented on September 3, 2024

I can't ssh into that specific server, so commands are a little complicated, unfortunately.
Migration triggers sounds pretty clever. Might also be a good way to have people deal with migration more (should maybe do that myself, too...

Closing as this will likely be covered or deprecated in the refactor.

from codeigniter4-schemas.

MGatner avatar MGatner commented on September 3, 2024

Once codeigniter4-tasks is ready that would be another good way to activate schema generation, assuming you have access to the cron (e.g. from CPanel).

All you ideas and work are appreciated! Please don't balk from PRs just because "somewhere down the road this might change". I'm sharing some of my ideas without a specific roadmap, but the reality is I'm strapped for time for much module development.

from codeigniter4-schemas.

sfadschm avatar sfadschm commented on September 3, 2024

That would be feasible. In gerneral, I like the idea of decoupling such actions from the app and its interface.

I will see what I think is really useful changes in the end, if I'm confident with a solution, I will happily reinstate the PR :)

from codeigniter4-schemas.

Related Issues (19)

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.