Skip to content
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

Add input transform support #35

Merged
merged 2 commits into from
Jan 19, 2018
Merged

Add input transform support #35

merged 2 commits into from
Jan 19, 2018

Conversation

thoov
Copy link
Member

@thoov thoov commented Dec 20, 2017

Related ember.js PR

Closes: #19

@thoov
Copy link
Member Author

thoov commented Dec 20, 2017

Right now the tests are not working. They are not able to capture the deprecations that are being thrown.

index.js Outdated
@@ -1,12 +1,14 @@
/* eslint-env node */
'use strict';

const transform = require('./addon/transforms/input');
Copy link
Member

Choose a reason for hiding this comment

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

Seems vaguely odd to require from addon while in node-land. Totally may work fine though. It just surprised me 😝

index.js Outdated
module.exports = {
name: 'ember-2-legacy',

included() {
this._super.included.apply(this, arguments);

this.import('vendor/ember/ember-template-compiler.js');
Copy link
Member Author

Choose a reason for hiding this comment

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

@rwjblue Is there a better way to do this only for the addons tests? or should I just include it in tests/index.html directly?

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, why do you need it?

Copy link
Member

Choose a reason for hiding this comment

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

I think the thing you will need to do is modify the tests to import hbs from 'htmlbars-inline-precompile'. If you do that, you will see the deprecations on the console at build time but you cannot do assert.expectDeprecation. In other words, you can only confirm that the old functionality works, but not that it deprecates. IMHO, thats a fine trade off, what do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm fine with not testing the deprecations as that was the only thing keeping me off of hbs. I was also worried about all of the logging in the console and not wanting that to show up after someone installs the addon but I just tested and that wont happen. I guess its because the tests are included locally but not when included in an app.

@thoov thoov force-pushed the transform-input branch 6 times, most recently from 9c019d9 to d4cda12 Compare January 9, 2018 20:57
deprecate = require('ember-source/dist/ember.prod').deprecate;
} catch(e) {
deprecate = require('../bower_components/ember/ember.prod').deprecate;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

@rwjblue Could you review this now? I think the only interesting thing in the PR is trying to grab the correct ember. Not sure if we need to support the bower flow as I believe we are dropping ember 3.0+ from bower correct?

@thoov thoov merged commit 75f760c into emberjs:master Jan 19, 2018
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.

2 participants