Skip to content

Commit 671b395

Browse files
authored
Merge pull request #786 from ember-cli/cleanup
big cleanup
2 parents 4721f12 + c4e77bd commit 671b395

File tree

15 files changed

+144
-1695
lines changed

15 files changed

+144
-1695
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ jobs:
8383
- ember-beta
8484
- ember-canary
8585
- embroider-safe
86+
- embroider-optimized
8687

8788
steps:
8889
- uses: actions/checkout@v3

README.md

Lines changed: 4 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -4,67 +4,10 @@
44

55
## Compatibility
66

7-
* Ember.js v3.8 or above
8-
* Ember CLI v3.8 or above
9-
* Node.js v12 or above
10-
11-
## Tagged Template Usage / Migrating from `htmlbars-inline-precompile`
12-
13-
Starting with version 4.0, this addon now includes the testing helper from [ember-cli-htmlbars-inline-precompile](https://github.com/ember-cli/ember-cli-htmlbars-inline-precompile)
14-
15-
This will require an update to the imports of the `hbs` helper in your tests:
16-
17-
Prior syntax:
18-
19-
```
20-
import hbs from 'htmlbars-inline-precompile';
21-
22-
...
23-
24-
await render(hbs`
25-
<MyComponent />
26-
`);
27-
```
28-
29-
New syntax:
30-
31-
```
32-
import { hbs } from 'ember-cli-htmlbars';
33-
34-
...
35-
36-
await render(hbs`
37-
<MyComponent />
38-
`);
39-
```
40-
41-
There is a [codemod](https://github.com/ember-codemods/ember-cli-htmlbars-inline-precompile-codemod) available to automate this change.
42-
43-
## Additional Trees
44-
45-
For addons which want additional customizations, they are able to interact with
46-
this addon directly.
47-
48-
```ts
49-
interface EmberCLIHTMLBars {
50-
/**
51-
Supports easier transpilation of non-standard input paths (e.g. to transpile
52-
a non-addon NPM dependency) while still leveraging the logic within
53-
ember-cli-htmlbars for transpiling (e.g. custom AST transforms, colocation, etc).
54-
*/
55-
transpileTree(inputTree: BroccoliTree): BroccoliTree;
56-
}
57-
```
58-
59-
### `transpileTree` usage
60-
61-
```js
62-
// find the ember-cli-htmlbars addon
63-
let htmlbarsAddon = this.addons.find(addon => addon.name === 'ember-cli-htmlbars');
64-
65-
// invoke .transpileTree passing in the custom input tree
66-
let transpiledCustomTree = htmlbarsAddon.transpileTree(someCustomTree);
67-
```
7+
* Ember.js v4.12 or above
8+
* Ember CLI v4.12 or above
9+
* `@embroider/compat` 3.4.3 or above (optional)
10+
* Node.js v18 or above
6811

6912
## Adding Custom Plugins
7013

@@ -141,28 +84,6 @@ export interface ASTPluginWithDeps extends ASTPlugin {
14184
}
14285
```
14386

144-
## Precompile HTMLBars template strings within other addons
145-
146-
```javascript
147-
module.exports = {
148-
name: 'my-addon-name',
149-
150-
setupPreprocessorRegistry: function(type, registry) {
151-
var htmlbarsPlugin = registry.load('template').find(function(plugin) {
152-
return plugin.name === 'ember-cli-htmlbars';
153-
});
154-
155-
// precompile any htmlbars template string via the precompile method on the
156-
// ember-cli-htmlbars plugin wrapper; `precompiled` will be a string of the
157-
// form:
158-
//
159-
// Ember.HTMLBars.template(function() {...})
160-
//
161-
var precompiled = htmlbarsPlugin.precompile("{{my-component}}");
162-
}
163-
};
164-
```
165-
16687
### Custom Template Compiler
16788

16889
You can still provide a custom path to the template compiler (e.g. to test

lib/addDependencyTracker.js

Lines changed: 0 additions & 71 deletions
This file was deleted.

lib/colocated-babel-plugin.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,9 @@ module.exports = function (babel) {
44
let t = babel.types;
55

66
function makeSetComponentTemplateExpression(state) {
7-
if (!state.opts.requiresModuleApiPolyfill) {
8-
return state._colocationEnsureImport(
9-
'setComponentTemplate',
10-
'@ember/component',
11-
);
12-
}
13-
14-
return t.memberExpression(
15-
t.identifier('Ember'),
16-
t.identifier('_setComponentTemplate'),
7+
return state._colocationEnsureImport(
8+
'setComponentTemplate',
9+
'@ember/component',
1710
);
1811
}
1912

0 commit comments

Comments
 (0)