Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

[FEAT] Implement Glimmer Components RFC #168

Merged

Conversation

pzuraq
Copy link
Member

@pzuraq pzuraq commented Jan 29, 2019

This PR turns the @glimmer/component package into an Ember addon, allowing it to work in both Ember.js and Glimmer.js applications. This works by keeping the GlimmerComponent class definition in a separate file that then gets imported by the Glimmer.js implementation in src, and is included in the Ember.js implementation via addon/index.js.

Notes:

  • Had to hack around @glimmer/di, it wants to be able to inject things universally but that is not allowed in the final design for GlimmerComponent. When we receive a ComponentFactory, we pull the class definition off it and use it directly instead.
  • The build has been simplified so all additional Ember Addon files will be pushed to the final dist. This means @glimmer/blueprint doesn't need to be treated too specially anymore, it just gets ignored by the packaging step so we don't build an empty dist.
  • I have Prettier on, so some files have been made ✨more beautiful✨. We should add it to the project as a whole.

@pzuraq pzuraq force-pushed the feat/implement-glimmer-components-rfc branch from 7a3a716 to ce21812 Compare January 30, 2019 01:04
@pzuraq pzuraq changed the title [WIP][FEAT] Implement Glimmer Components RFC [FEAT] Implement Glimmer Components RFC Jan 30, 2019
@pzuraq pzuraq force-pushed the feat/implement-glimmer-components-rfc branch from ce21812 to 7f515d6 Compare January 30, 2019 03:05
@pzuraq pzuraq force-pushed the feat/implement-glimmer-components-rfc branch 2 times, most recently from 8e51bd0 to 2325a21 Compare January 30, 2019 03:52
@pzuraq
Copy link
Member Author

pzuraq commented Jan 30, 2019

Tested in both a Glimmer.js and Ember.js app generated using the default blueprints. The Glimmer.js app was hard to test, due to the way the application pipeline works for it. I ended up having to actually copy/paste the dist into node_modules but that seemed to work, if anyone knows a better way I'm all ears 😄

CI: !!process.env.CI
}
},
[require.resolve('babel-plugin-debug-macros'), {
Copy link
Contributor

Choose a reason for hiding this comment

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

Were the changes in this file needed for Ember compatibility, or just general cleanup?

Copy link
Member Author

Choose a reason for hiding this comment

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

Something happened as I was upgrading that caused the babel-plugin-debug-macros options have changed deprecation message to start popping up everywhere, so I figured it would be good to clean it up and update.

@pzuraq pzuraq force-pushed the feat/implement-glimmer-components-rfc branch from f063467 to 21e30eb Compare February 9, 2019 00:50
This PR turns the `@glimmer/component` package into an Ember addon,
allowing it to work in both Ember.js and Glimmer.js applications. This
works by keeping the `GlimmerComponent` class definition in a separate
file that then gets imported by the Glimmer.js implementation in `src`,
and is included in the Ember.js implementation via `addon/index.js`.
@pzuraq pzuraq force-pushed the feat/implement-glimmer-components-rfc branch from 21e30eb to 5ec0400 Compare February 9, 2019 01:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants