Skip to content

Switch to ember-cli-htmlbars #1519

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

Merged
merged 1 commit into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/ember/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Now, with that setup out of the way, let’s get back to talking about the text
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { hbs } from 'ember-cli-htmlbars';

import User from 'app/types/user';

Expand Down Expand Up @@ -283,7 +283,7 @@ Putting it all together, this is what our updated test definition would look lik
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, TestContext } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { hbs } from 'ember-cli-htmlbars';

import User from 'app/types/user';

Expand Down
12 changes: 6 additions & 6 deletions docs/ts/current-limitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ Addons need to import templates from the associated `.hbs` file to bind to the l

```ts
declare module '\*/template' {
import { TemplateFactory } from 'htmlbars-inline-precompile';
import { TemplateFactory } from 'ember-cli-htmlbars';
const template: TemplateFactory; export default template;
}


declare module 'app/templates/\*' {
import { TemplateFactory } from 'htmlbars-inline-precompile';
import { TemplateFactory } from 'ember-cli-htmlbars';
const template: TemplateFactory; export default template;
}

declare module 'addon/templates/\*' {
import { TemplateFactory } from 'htmlbars-inline-precompile';
import { TemplateFactory } from 'ember-cli-htmlbars';
const template: TemplateFactory; export default template;
}
```
Expand All @@ -42,14 +42,14 @@ import { action } from '@ember/object';

export default class MyGame extends Component {
@action turnWheel(degrees: number) {
// ...
// ...
}
}
}
```

```hbs
<button {{on "click" (fn this.turnWheel "potato")}}>
Click Me
Click Me
</button>
```

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/components/js-importing-ts-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { hbs } from 'ember-cli-htmlbars';

module('Integration | Component | js importing ts', function (hooks) {
setupRenderingTest(hooks);
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/components/ts-component-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { hbs } from 'ember-cli-htmlbars';

module('Integration | Component | ts component', function (hooks) {
setupRenderingTest(hooks);
Expand Down
3 changes: 1 addition & 2 deletions ts/blueprints/ember-cli-typescript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export {};`;
function buildTemplateDeclarations(projectName, layout) {
const comment = '// Types for compiled templates';
const moduleBody = `
import { TemplateFactory } from 'htmlbars-inline-precompile';
import { TemplateFactory } from 'ember-cli-htmlbars';

const tmpl: TemplateFactory;
export default tmpl;
Expand Down Expand Up @@ -171,7 +171,6 @@ module.exports = {
'@types/ember__component',
'@types/ember__routing',
'@types/rsvp',
'@types/htmlbars-inline-precompile',
];

if (this._has('@ember/jquery')) {
Expand Down
2 changes: 1 addition & 1 deletion ts/tests/blueprints/ember-cli-typescript-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ describe('Acceptance: ember-cli-typescript generator', function () {
const globalTypes = file('types/global.d.ts');
expect(globalTypes).to.exist;
expect(globalTypes).to.include("declare module 'my-addon/templates/*'").to.include(`
import { TemplateFactory } from 'htmlbars-inline-precompile';
import { TemplateFactory } from 'ember-cli-htmlbars';

const tmpl: TemplateFactory;
export default tmpl;
Expand Down