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

Should unresolved imports be errors? #110

Open
dominicbarnes opened this issue Nov 15, 2014 · 7 comments
Open

Should unresolved imports be errors? #110

dominicbarnes opened this issue Nov 15, 2014 · 7 comments

Comments

@dominicbarnes
Copy link
Contributor

While using duo-myth, I was halted because unresolved imports were throwing errors.

@import "suitcss/base";

Gets me:

Error: Failed to find suitcss/base

I'm going to propose that the default behavior of duo-myth skip imports processing. (since duo handles that on it's own of course) However, it seems like the default behavior for myth should perhaps be to warn, rather than throw an error.

Thoughts?

@ianstormtaylor
Copy link
Contributor

That sounds reasonable to me I think, although differs from Myth's other broken cases where we error like for color() functions, but seems like Myth should be run after all of the Duo pieces have already been imported?

@dominicbarnes
Copy link
Contributor Author

Currently, duo plugins operate on each individual file, before the entire build is collated. In duojs/duo#346, the discussion has been started about how to specify a plugin to run on the build as a whole instead. (but that hasn't been agreed upon yet)

@ianstormtaylor
Copy link
Contributor

Gotcha, makes sense!

Will the Myth stuff work in the case you're using it for if the variables are included in a separate Duo file then? Seems more stuff might break in that case without applying it to the full build

@ianstormtaylor
Copy link
Contributor

Btw for the warning stuff, I think you make a lot of sense still regardless of Duo, we might want to start warning for everything and be non-breaking like CSS is natively. Does that sound right? I can't really think of a case where you'd depend on the errors, since CSS itself can be misformed and just fine?

@dominicbarnes
Copy link
Contributor Author

Yeah, variables won't work anymore once myth is no longer handling the imports. That's the big problem I'm wanting to address with duojs/duo#346.

And yeah, I couldn't agree more about warning about these types of things. CSS doesn't throw an error, but it doesn't warn either. (but the warning comes from the builder, not the CSS itself so I think it's still consistent!)

@dominicbarnes
Copy link
Contributor Author

Since myth aims to be consistent with CSS, (even if it's "future" syntax) I think using warnings here is far more appropriate.

We could add a "strict mode" for myth, that way someone wanting to fail on these types of conditions can still do it. Thoughts?

@ianstormtaylor
Copy link
Contributor

Strict mode sounds really smart! I'm +1 to making them all warnings

On Sat, Nov 15, 2014 at 6:53 PM, Dominic Barnes [email protected]
wrote:

Since myth aims to be consistent with CSS, (even if it's "future" syntax)
I think using warnings here is far more appropriate.

We could add a "strict mode" for myth, that way someone wanting to fail on
these types of conditions can still do it. Thoughts?


Reply to this email directly or view it on GitHub
#110 (comment).

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

No branches or pull requests

2 participants