-
Notifications
You must be signed in to change notification settings - Fork 49
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
Addon author guide #39
Conversation
196be67
to
dc28ad7
Compare
changes to ensure that your addon runs correctly in the FastBoot | ||
environment. | ||
|
||
Remember that when updating your addons for FastBoot compatibility, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding similar language to the README (and site) for app developers. This is the most common class of errors everyone will encounter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arjansingh I was going to extract some of the material here to an "App Upgrade Guide," which shares a lot of material, but there is some addon-specific stuff I don't want to overwhelm people.
@tomdale honestly with the exception of the last sections this stuff is applicable to App as well as Addon developers. I'd consider making this just a plain developer guide. Edit: And generally I like it. |
environment. | ||
|
||
Remember that when updating your addons for FastBoot compatibility, | ||
your code now must run in both a browser *and* Node.js. Most |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"your code now must run" -> "your code must now run" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@locks I think both are correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your ordering sounds weird to my ear for some reason, not a grammatical nitpick
Only question I have: is the |
### Tracking It Down | ||
|
||
FastBoot works by turning an Ember application and all of its | ||
dependencies (including your addon) into a single bundle of JavaScript. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm being overly precious here, but what do you think about emdashes instead of parens here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, em dashes denote an abrupt change of thought, or an interjection. Parentheses denote an explanatory or clarifying remark.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But commas may be more appropriate here.
@davidpett I'm hoping to RFC an "optional injection" feature to Ember.js, in which case we can update that section and the only that that changes is the PR, not the code that consumes it. And you still need to look up the owner to get the service. |
This looks good to me, and reads well. Thanks @tomdale! |
if (!process.env.EMBER_CLI_FASTBOOT) { | ||
// This will only be included in the browser build | ||
app.import('some/jquery.plugin.js') | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may seem obvious, but it's easy to miss if you're just swatting at a "don't break the build" problem -- this means that jquery.plugin.js
is not available in your app, and it's worth doing a quick check to ensure this is handled gracefully.
For example, if you're importing d3, and use in helpers for number formatting or something -- the d3 module will now be undefined. The consequence will be that the fastboot-generated HTML will either be incorrect, or incomplete.
No description provided.