Skip to content
This repository was archived by the owner on Mar 22, 2019. It is now read-only.

Add section on Module Unification Packages#3536

Merged
jayjayjpg merged 2 commits intoblog/embertimes-62from
Alonski-Module-Unification-Packages
Aug 30, 2018
Merged

Add section on Module Unification Packages#3536
jayjayjpg merged 2 commits intoblog/embertimes-62from
Alonski-Module-Unification-Packages

Conversation

@Alonski
Copy link
Member

@Alonski Alonski commented Aug 29, 2018

This might be a bit too long? Not sure where to cut it or if I maybe need to add more?

What it does

Related Issue(s)

Sources

This might be a bit too long? Not sure where to cut it or if I maybe need to add more?
@Alonski Alonski requested review from a team and mixonic August 30, 2018 09:24

## [SECTION TITLE](#section-url)
## [Module Unification with Ember Addons](https://github.com/emberjs/rfcs/pull/367) 🎁
[Module Unification Packages](https://github.com/emberjs/rfcs/pull/367) is a new RFC, created by [@mixonic](https://github.com/mixonic), that sets out to describe how packages, **Ember Addons**, work and how apps and addons will migrate to the new [Module Unification](https://github.com/emberjs/rfcs/blob/master/text/0143-module-unification.md) structure from the classic structure. This RFC iterates on and is set to replace another RFC called [Module Unification Namespaces](https://github.com/emberjs/rfcs/pull/309) which had some syntax, like the `::` syntax, that proved problematic.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that sets out to describe how packages, Ember Addons

I suggest sticking with "describe how Ember apps and addons will migrate to the new...". The terminology of "package" is confusing if this is someones first introduction to the RFC. Focusing on "this is how addons and apps work under MU" is a good high level message.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok makes sense. Thanks

{{! invokes node_modules/gadget/src/ui/components/Widget/component.js }}

{{use Widget from 'gadget'}}
<Widget @options=someOptions @value=someValue />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My syntax here was incorrect, I need to fix it in the RFC. This should be:

{{! invokes node_modules/gadget/src/ui/components/Widget/component.js }}

{{use Widget from 'gadget'}}
<Widget @options={{someOptions}} @value={{someValue}} />

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good catch!

## [Module Unification with Ember Addons](https://github.com/emberjs/rfcs/pull/367) 🎁
[Module Unification Packages](https://github.com/emberjs/rfcs/pull/367) is a new RFC, created by [@mixonic](https://github.com/mixonic), that sets out to describe how packages, **Ember Addons**, work and how apps and addons will migrate to the new [Module Unification](https://github.com/emberjs/rfcs/blob/master/text/0143-module-unification.md) structure from the classic structure. This RFC iterates on and is set to replace another RFC called [Module Unification Namespaces](https://github.com/emberjs/rfcs/pull/309) which had some syntax, like the `::` syntax, that proved problematic.

This RFC proposes to add a new `{{use}}` helper that will be used to call external components that are provided by addons. This helper is a subset of the javascript imports that we are used to.
Copy link
Member

@mixonic mixonic Aug 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe:

This RFC proposes to add a new {{use}} helper. This helper imports components from an addon into an application's template. The helper provides a subset of the functionality JavaScript imports have, but is syntactically slightly different.


Something else that is proposed in this RFC is the use of a template `prelude.hbs` that, **at compile time**, will be injected into every template in the app. This can be used to inject global components such as the widely used `{{t 'token'}}` component used for *internationalization*.

Services also get some **love** in this RFC. The suggestion is that all service calls to addons will become more verbose in that the injected service will need to provide where to inject from.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps:

Services also get some love in this RFC. The suggestion is that all service injections from an addon to an app will need to be explicit about their source package. This results in more verbosity, but also greater clarity and opportunity for optimizations.

});
```

There is also some proposals regarding `owner` APIs such as `owner.lookup()` and `owner.factoryFor()` which have also become more explicit.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are also some proposals

There is also some proposals regarding `owner` APIs such as `owner.lookup()` and `owner.factoryFor()` which have also become more explicit.

All in all this, **very well written**, RFC is a great chance to learn about possible changes to Ember and the Module Unification structure.
If you have any concerns or questions feel free to ask in the [RFC issue](https://github.com/emberjs/rfcs/pull/367) and join in on the conversation.
Copy link
Member

@mixonic mixonic Aug 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

join in the conversation by visiting #st-module-unification on Ember.js Community Slack.

@Alonski
Copy link
Member Author

Alonski commented Aug 30, 2018

Finished fixing comments by @mixonic. Thanks for the help!

Copy link
Member

@jayjayjpg jayjayjpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads great ✨ Thank you for another awesome writeup this week!

@jayjayjpg jayjayjpg merged commit d8a7a12 into blog/embertimes-62 Aug 30, 2018
@jayjayjpg jayjayjpg deleted the Alonski-Module-Unification-Packages branch August 31, 2018 09:48
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 this pull request may close these issues.

3 participants