Skip to content

Commit

Permalink
Merge pull request #1519 from bmish/ember-cli-htmlbars
Browse files Browse the repository at this point in the history
Switch to `ember-cli-htmlbars`
  • Loading branch information
chriskrycho committed Sep 2, 2022
2 parents 5e4a98a + 28945b9 commit 7f10d23
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
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

0 comments on commit 7f10d23

Please sign in to comment.