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

Invert mixin initialization order. #329

Closed
jorgebucaran opened this issue Aug 16, 2017 · 5 comments
Closed

Invert mixin initialization order. #329

jorgebucaran opened this issue Aug 16, 2017 · 5 comments
Labels
discussion enhancement New feature or request

Comments

@jorgebucaran
Copy link
Owner

jorgebucaran commented Aug 16, 2017

Currently we are initializing the app, then mixins. This makes it impossible for the app to overwrite a definition added by a mixin.

Your app should have the highest precedence and not mixins.

@jorgebucaran jorgebucaran added discussion enhancement New feature or request labels Aug 16, 2017
@zaceno
Copy link
Contributor

zaceno commented Aug 16, 2017

That makes sense!

@Swizz
Copy link
Contributor

Swizz commented Aug 16, 2017

Totally agree !

@andyrj
Copy link
Contributor

andyrj commented Aug 17, 2017

💯 agree app should take precedence

@jorgebucaran
Copy link
Owner Author

jorgebucaran commented Aug 17, 2017

I'll create a PR with the changes. 💯

As a side effect, I'd prefer to drop presets (builtin mixin group merging) with this change since it complicates the implementation.

Less is more remember? @zaceno :)

@zaceno
Copy link
Contributor

zaceno commented Aug 17, 2017

I don't think that the current idea of "presets" (or "mixins in mixins") is especially important anyway. In fact it only complicates things when you're trying to do things like scoped mixins.

Anyhow, presets, or bundling mixins, can still be done in an ok-nice way with array spreads.

const MyMixinPreset = [MixinA, MixinB]

app({
  mixins: [AMixin, ...MyMixinPreset, AnotherMixin],
  ...
})

EDIT: Code fences.

jorgebucaran pushed a commit that referenced this issue Aug 18, 2017
- Shave off presets (mixin mixins) in the process.
- Update tests & docs.
jorgebucaran pushed a commit that referenced this issue Aug 18, 2017
- Shave off presets (mixin mixins) in the process.
- Update tests & docs.
jorgebucaran added a commit that referenced this issue Jan 7, 2018
- Shave off presets (mixin mixins) in the process.
- Update tests & docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants