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

[BUGFIX release] Updated blueprints for component and helper tests to output the correct hbs import statement #18691

Merged
merged 1 commit into from
Jan 24, 2020
Merged

[BUGFIX release] Updated blueprints for component and helper tests to output the correct hbs import statement #18691

merged 1 commit into from
Jan 24, 2020

Conversation

ijlee2
Copy link
Member

@ijlee2 ijlee2 commented Jan 19, 2020

Description

This PR closes #18626.

Tests

I wanted to write tests per contributing guide, but couldn't figure out how to make this.project.addons include ember-cli-htmlbars in a test. Currently, there isn't a test that checks the component test when the version of ember-cli-htmlbars is at least 4.0.0-alpha.1, so I didn't have an example that I could follow.

It seemed like ember-cli-blueprint-test-helpers currently doesn't support updating the addons attribute (https://github.com/ember-cli/ember-cli-blueprint-test-helpers/blob/master/lib/modify-packages.js#L20-L26). If I missed something and setting addons is possible, please let me know and I'd be happy to add tests.

I did manually test locally using yarn link ember-source on a new Ember 3.15 project. If the version of ember-cli-htmlbars is at least 4.0.0-alpha.1, the generators will add the named import statement. If the version is less, or if ember-cli-htmlbars doesn't exist, the generators will add the default import statement.

return true;
} else if (semver.gte(htmlbarsAddon.pkg.version, '4.0.0-alpha.1')) {
Copy link
Member Author

@ijlee2 ijlee2 Jan 19, 2020

Choose a reason for hiding this comment

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

Line 94 implies that, if the version is ember-cli-htmlbars is 3.x or less, we will still use the named import (because we are returning undefined, a falsey value). Could you verify if this was intended or a bug?

Copy link
Member

Choose a reason for hiding this comment

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

3.x should use import hbs from 'htmlbars-inline-precompile', which AFAICT is still what is done after this change.

@ijlee2 ijlee2 requested review from rwjblue and locks January 19, 2020 23:58
@ijlee2 ijlee2 changed the title [BUGFIX] Updated blueprints for component and helper tests to output the correct hbs import statement [BUGFIX release] Updated blueprints for component and helper tests to output the correct hbs import statement Jan 20, 2020
@locks locks assigned locks and unassigned locks Jan 20, 2020
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.

Ember 3.15 - Helper test always imports hbs from htmlbars-inline-precompile
3 participants