Skip to content

Update blueprints to use native JS classes - #17621

Merged
rwjblue merged 5 commits into
emberjs:masterfrom
ppcano:native-controller-blueprint
Feb 15, 2019
Merged

rwjblue merged 5 commits into
emberjs:masterfrom
ppcano:native-controller-blueprint

Conversation

@ppcano

@ppcano ppcano commented Feb 15, 2019 •

Copy link
Copy Markdown
Contributor

Implements Update blueprints for each object type to use native JS classes of #17234

Related PRs ember-cli/ember-octane-blueprint#36 and ember-cli/ember-octane-blueprint#37


const generateFakePackageManifest = require('../helpers/generate-fake-package-manifest');
const enableModuleUnification = require('../helpers/module-unification').enableModuleUnification;
const enableOctane = require('../helpers/setup-test-environment').enableOctane;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I recommend to include the enableModuleUnification function into the /helpers/setup-test-environment module, but I would like to do that in an independent PR.

@rwjblue rwjblue left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Only one minor suggested tweak.

Comment thread blueprints/controller/index.js Resolved

module.exports = function(blueprint) {
blueprint.filesPath = function() {
let rootPath = process.env.EMBER_VERSION === 'OCTANE' ? 'native-files' : 'files';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For reference, we intend to come up with a better "flag" than process.env.EMBER_VERSION, but this unlocks actually being able to do the blueprint work while we figure that out.

@ppcano
ppcano force-pushed the native-controller-blueprint branch from 3f1ddf8 to 698e8b5 Compare February 15, 2019 17:50

@rwjblue rwjblue left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Thanks for working on this!

@ppcano

ppcano commented Feb 15, 2019

Copy link
Copy Markdown
Contributor Author

@rwjblue, I have included the other blueprints and this is ready for merging now. 


Do we have also to support Native classes in the Ember Data blueprints? ember-decorators includes them, but they are not described in the Octane tracking issue.



ember-cli/ember-octane-blueprint#37 is related to this PR in case you want to share your opinion on how/if to get rid of the ember-decorators blueprints.

@rwjblue
rwjblue merged commit 98b3128 into emberjs:master Feb 15, 2019
@ppcano ppcano changed the title Update controller blueprint to use native JS classes Update blueprints to use native JS classes Feb 16, 2019

module.exports = function(blueprint) {
blueprint.filesPath = function() {
let rootPath = process.env.EMBER_VERSION === 'OCTANE' ? 'native-files' : 'files';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wasn't this edition in the blueprint? Am I misremembering?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't understand the question.

Here is checking if the ENV.EMBER_VERSION is equal to 'OCTANEto use Native files instead of Emberextend`.

ember-cli/ember-octane-blueprint#36 set the env variable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ah ok, you right. I was misremembering. thank you! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants