Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECS Prep: Decouple config #703

Merged
merged 3 commits into from Dec 8, 2019
Merged

ECS Prep: Decouple config #703

merged 3 commits into from Dec 8, 2019

Conversation

epage
Copy link
Member

@epage epage commented Dec 8, 2019

There are two ways of handling config structures

  • Give config knowledge of your logic (what we do)
  • Give logic knowledge of your config (what we will do)

Changing this is important for switching to an ECS because the structs for the logic are going to be split up.

BREAKING CHANGE: Old-style frontmatter is removed and some config keys
are renamed:

  • Sort Order: Asc / Desc were lowercased
  • Sass Style: Nested / Expanded / Compact / Compressed were lowercased
  • Pagination: All, Tags, Categories, Dates were lowercased

epage and others added 3 commits December 7, 2019 18:12
BREAKING CHANGE: Old-style frontmatter is removed and some config keys
are renamed:
- Sort Order: Asc / Desc were lowercased
- Sass Style: Nested / Expanded / Compact / Compressed were lowercased
- Pagination: All, Tags, Categories, Dates were lowercased
@epage epage merged commit 819e727 into cobalt-org:master Dec 8, 2019
@epage epage deleted the ecs branch December 8, 2019 01:57
@Geobert
Copy link
Contributor

Geobert commented Dec 9, 2019

Give config knowledge of your logic (what we do)
Give logic knowledge of your config (what we will do)

Can you explain the difference please? I don't get it :-/

Also, why another crate for the config, one thing I didn't like about Zola was the multiple crates arch, it means more Cargo.toml to maintain

@epage
Copy link
Member Author

epage commented Dec 9, 2019

So cobalt used to have the Config also be Builders for the processing logic. The problem with that is how I'm splitting up the processing logic. So now instead the configs are standalone and the processing logic takes the Config as inputs so I can refactor the processing logic without touching the config.

Also, why another crate for the config, one thing I didn't like about Zola was the multiple crates arch, it means more Cargo.toml to maintain

I don't know if this will continue long term. In part it is an experiment to see if a "low deps" crate will be useful for external tools hat manipulate your site. Otherwise, it really is a bookkeeping thing to make it easier for me to experiment. I was able to iterate on and test my config logic in isolation, deferring migrating cobalt. It also let's me track re-licensing.

@epage
Copy link
Member Author

epage commented Dec 9, 2019

Also, why another crate for the config, one thing I didn't like about Zola was the multiple crates arch, it means more Cargo.toml to maintain

I'm curious, in what way do you find it more work to maintain more crates? There is effort in the initial split but after that, with cargo-release, it seems to be just about the same level of effort to me.

@Geobert
Copy link
Contributor

Geobert commented Dec 9, 2019

I'm curious, in what way do you find it more work to maintain more crates? There is effort in the initial split but after that, with cargo-release, it seems to be just about the same level of effort to me.

I wanted to work on tera to add something to zola and I was wondering which subscrate needs to point to my local version of tera. The maintainer told me to changed them all, it's what's he's doing anyway

@epage
Copy link
Member Author

epage commented Dec 9, 2019

I wanted to work on tera to add something to zola and I was wondering which subscrate needs to point to my local version of tera. The maintainer told me to changed them all, it's what's he's doing anyway

So yes, shared dependencies in public APIs do need to be updated in each crate.

However, when I've looked at Zola, it looks like they have less separation of their layers. For example, I find it unusual that the config crate depends on syntect.

The other thing in cobalt's favor is I don't plan to split up cobalt into as many crates. Currently, I'm only looking at config, model, and bin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants