Giter Site home page Giter Site logo

Comments (10)

fpellanda avatar fpellanda commented on August 13, 2024

Maybe we should do it the "Rails" way. Rails does not use yaml files for configuration... Why yaml?

from kuhsaft.

alexanderadam avatar alexanderadam commented on August 13, 2024

Well. The database.yml for instance is a well known example of yaml used for configuring rails apps.
Even external stuff like travis or rubocop use yaml for configuration.
I don't think that yaml is so bad at all. 😉

Initializers or something else which leads to 'normal' keys in the config also would be fine in my opinion.
But the also would result into large code-bases that contain configuration anyway.

from kuhsaft.

fpellanda avatar fpellanda commented on August 13, 2024

Yes, right. Rails uses YAML. But I meant the configuration for gems.

I don't know what you want to configure, I just want to prevent implementing the configuration mechanism twice - when we realize that YAML is not enough.

I mean, I don't know a gem that uses yaml files for configuration. Do you?

from kuhsaft.

alexanderadam avatar alexanderadam commented on August 13, 2024

kuhsaft is an engine which is basically a rails app anyway. 😉

But sure, as I already mentioned for example rubocop and travis.
I could image something like this which could be set in the rails instance to overwrite some kuhsaft defaults

asset_brick:
  styles: 'pdf word excel button'
  user_can_add_childs: false
  renders_own_childs: true
  allowed_brick_types: '$inherit'
  allow_voda: true

As I've said already: that is really just my personal preference.
I have no problem to use something different if yaml files aren't an adequate solution.
I just find the current mix of business logic and configuration not optimal - that's all. 😉

from kuhsaft.

fpellanda avatar fpellanda commented on August 13, 2024

So

configuration_implementation:
  yaml: +1
  ruby: +1

Other votes? ;)

from kuhsaft.

effkay avatar effkay commented on August 13, 2024

@alexanderadam @fpellanda I generally am in favor of extracting configuration and separating it from business logic. Going all the way would mean yml files and I have no objection to that. So 👍 for a yml file!

from kuhsaft.

manufaktor avatar manufaktor commented on August 13, 2024

TLDR: keep it in ruby land :)

My 2 cents:
The underlying issue here is the de-separation of model and view-model which was - at the time we built this - simply a shortcut we took to make it useable. Imagine you'd build the inputs strictly client side, you'd essentially have a client model handling all of this.

Imho allowed_brick_types: '$inherit' is a smell you're eventually going to invent a yml dsl here. Also I don't believe it's true the values are not going to change in the app lifecycle. The initial imagination was that certain options can be data/context sensitive, for example: don't let users add childs when there's already 5 childs attached. This is certainly easier to extend in ruby land than via yml configuration.

FYI these are use cases I'm evaluating for the current project I'm working on.

from kuhsaft.

effkay avatar effkay commented on August 13, 2024

@manufaktor good ponts, thanks a lot for your input! The context sensitive options are indeed a nice idea, though I don't think we used them a lot. Are you suggesting a split between brick models and brick view models?

from kuhsaft.

manufaktor avatar manufaktor commented on August 13, 2024

@effkay basically I'd just delegate the options in question to a config object with some sane defaults. You could also go the decorator route, all I'm saying I'd prefer not to have YML :trollface: (You could always add that to back the config objects but I'm sharing @fpellanda 's concerns).

from kuhsaft.

effkay avatar effkay commented on August 13, 2024

Migrated / Added to qBrick roadmap: https://github.com/screenconcept/qbrick

from kuhsaft.

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.