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

Before Denali-Babel #1

Closed
knownasilya opened this issue Nov 3, 2016 · 2 comments
Closed

Before Denali-Babel #1

knownasilya opened this issue Nov 3, 2016 · 2 comments

Comments

@knownasilya
Copy link
Member

knownasilya commented Nov 3, 2016

So this line

  "denali": {
    "before": "denali-babel"
  }

Seems like it assumes too much, because if you wanted to use typescript, you wouldn't use babel, and then this addon is unusable. Maybe this should be a list of addons to check against, or a type of addon that babel and typescript fall under.

"before": {
  "type": "preprocessor",
  "category": "js"
}

needs some bikeshedding

@davewasmer
Copy link
Contributor

Good point, hadn't thought of that.

I hesitate to add "types" or categories of addons. Getting the exhaustive list of types correct, and the boundaries between them, is difficult / impossible without lots of experience. Which means lots of potentially breaking API changes as we figure out "oh, we actually really need a js-preprocessor type and an asset-preprocessor type". And I'm not even sure there is an exhaustive list of types that satisfies all use cases. When faced with that kind of tradeoff, my gut says their's often a more fundamental primitive that could solve the problem.

As an alternative, we could support configuration at the app level to specify addon ordering, i.e.

// my-app/package.json
"denali": {
  "addons": {
    "denali-eslint": {
      "before": "denali-babel"
    }
  }
}

I think something like the above, where the consuming app can specify load order, would provide an escape valve - no matter what, you can always override the order. The downside here is it's more configuration for the end user. But we could ship addons like this one with some sensible defaults - i.e. "before": [ "denali-babel", "denali-typescript", "denali-flow" ]. I imagine there will only be a handful of commonly used addons that need explicit ordering like this, so maintaining that shouldn't be difficult, and there's no explicit guarantee that the load order is supported anyway. And the more esoteric use cases have the escape valve they need.

Thoughts?

@davewasmer
Copy link
Contributor

Closing for lack of activity.

Definitely open to pursuing this concept further, but I don't think it's causing any harm right now to ship with the before: denali-babel config - it's just that there might be a nicer solution.

If this does become problematic, we can revisit.

This issue was closed.
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

No branches or pull requests

2 participants