Skip to content
This repository has been archived by the owner on Aug 2, 2018. It is now read-only.

support css in manifest #252

Closed
lancejpollard opened this issue Aug 25, 2014 · 3 comments · Fixed by #286
Closed

support css in manifest #252

lancejpollard opened this issue Aug 25, 2014 · 3 comments · Fixed by #286

Comments

@lancejpollard
Copy link
Member

Based on some of the feedback about the need for a manifest in large applications, and how the non-manifest workflow is mainly for just getting started hacking on things, and how it's easier to see what dependencies are being used in a codebase when they are in a manifest (rather than having to go through the source code to figure it out, like @wycats was mentioning), what do you guys think about adding CSS support back to the manifests?

Otherwise, it's like we will have a component.json that supports script files, but not CSS. And so while it would become easier to understand and work with JavaScript, we wouldn't get any of these benefits in CSS.

Right now I am in the middle of porting every https://github.com/logo repo to use duo, which requires:

  1. moving the old index.css to style.css or something, so it would still support component.
  2. adding @import 'logo/logo'; before the CSS inside index.css for every repo.

Every logo repo there has 1 dependency: logo/logo, so you have to create a new file, and add that as an import for it to work.

You have to do this if you want it to work with component and duo (at least during the period of fully porting over to duo, where old code will still read from github using component, while new code will read from github using duo).

It's not such a big deal to do if you know that this is the way things will be from here on out in duo. But one thing I have noticed is that CSS and JS have a very different workflow if we're assuming manifests are the way to go in large applications.

On one hand, JS is very clear: you have all your deps defined in component.json. When we get the lock file, then all the deps will be locked based on what's in there.

On the other hand, CSS you have to do a lot of digging to figure out what's going on. The dependencies are spread throughout a bunch of files, for one. And if you have CSS dependencies, then you won't get any warning or anything if, although you have included your CSS dependency in component.json, you haven't added it as an @import in some index.css file. It's kind of tricky and doesn't feel "solid" I guess, unlike the JS with the manifest.

I don't have a strong opinion either way, just want to know what direction we are planning on taking things, and if CSS and JS dependencies will work the same (possible to just use manifest for everything) or differently (manifest only works for JS). So I can avoid having to port everything over to the non-manifest-CSS way now, and have to port it back :)

@matthewmueller
Copy link
Contributor

@lancejpollard Maybe I'm misunderstanding, but you can do:

{
  "name": "apple-logo",
  "version": "0.0.1"
  "dependencies": {
    "logo/logo": "1.x"
  }
}

Then in your CSS:

@import "logo";

// ...

@matthewmueller
Copy link
Contributor

Also, to clarify my position. I have no clue what will be the better workflow between manifests and no manifests. I think that will be more clear as more people try out duo.

It's also incredibly easy to find requires/imports in the codebase with @guille's spot(1) tool.

$ spot "@import.."
$ spot "require.."

@matthewmueller
Copy link
Contributor

done!

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

Successfully merging a pull request may close this issue.

2 participants