Convert built-in blueprints to TypeScript#19962
Convert built-in blueprints to TypeScript#19962rwjblue merged 14 commits intoemberjs:masterfrom cafreeman:cfreeman/typescript-blueprints
Conversation
| "ember-cli-normalize-entity-name": "^1.0.0", | ||
| "ember-cli-path-utils": "^1.0.0", | ||
| "ember-cli-string-utils": "^1.1.0", | ||
| "ember-cli-typescript-blueprint-polyfill": "^0.1.0", |
There was a problem hiding this comment.
Will update this to ^1.0.0 once we know there aren't any other changes needed.
| @@ -0,0 +1,6 @@ | |||
| export function initialize(appInstance) { | |||
There was a problem hiding this comment.
Can we call this "owner" instead? In practice, that is what it is...
| export function initialize(appInstance) { | |
| export function initialize(owner) { |
|
This looks great!!! I think the only thing left is to feature flag this so that we can easily toggle it on/off without reverting. Unfortunately, we don't have infrastructure setup to be able to read the What I think we should do is:
// TODO: this should be reading from the @ember/canary-features module
// need to refactor broccoli/features.js to be able to work more similarly
// to https://github.com/emberjs/data/pull/6231
const EMBER_TYPESCRIPT_BLUEPRINTS = false;
module.exports = function() {
return 'EMBER_TYPESCRIPT_BLUEPRINTS' in process.env
? process.env.EMBER_TYPESCRIPT_BLUEPRINTS
: EMBER_TYPESCRIPT_BLUEPRINTS;
};
|
|
Chatted with @cafreeman offline, and I think he's come up with a better (and simpler) way to do the feature flagging. |
|
Eeeck. Looks like we have some conflicts now, my apologies RE: the delays landing this. @cafreeman - Mind rebasing / fixing things up? |
|
@rwjblue Just resolved all the conflicts, we should be good to go now! |
This PR is the ember.js counterpart to the work done in ember-cli to add support for typescript blueprints, both of which constitute the implementation of emberjs/rfcs#776.
This PR converts many (though not all) of the built-in ember blueprints. Notably, it excludes the mixin blueprint as well as the older test blueprints for both mocha and qunit. The only test blueprints that were converted were the post-testing overhaul blueprints (i.e. the ones that are now the defaults).
In order to prevent any compatibility issues that could arise from someone upgrading
ember-sourcewhile still on an older version of Ember CLI, this PR also includes a polyfill for the typescript blueprint functionality.