Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ember-cli/ember-cli-htmlbars
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.3.1
Choose a base ref
...
head repository: ember-cli/ember-cli-htmlbars
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.3.1
Choose a head ref
Loading
12 changes: 4 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -28,12 +28,12 @@ jobs:

test:
name: Tests
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest

strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [8.x, 10.x, 12.x]
os: [ubuntu, windows]
node-version: [10.x, 12.x, 13.x, 14.x]

steps:
- uses: actions/checkout@v1
@@ -75,17 +75,13 @@ jobs:
strategy:
matrix:
ember-try-scenario:
- ember-lts-2.12
- ember-lts-2.16
- ember-lts-2.18
- ember-lts-3.4
- ember-lts-3.8
- ember-lts-3.12
- ember-lts-3.16
- ember-release
- ember-octane
- ember-beta
- ember-canary
- ember-default
- ember-default-with-jquery
- with-ember-cli-htmlbars-inline-precompile

87 changes: 87 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,90 @@
## v5.3.1 (2020-08-11)

#### :bug: Bug Fix
* [#599](https://github.com/ember-cli/ember-cli-htmlbars/pull/599) Move `ember-template-lint` to `devDependencies` (from `dependencies`) ([@jamescdavis](https://github.com/jamescdavis))

#### Committers: 1
- James C. Davis ([@jamescdavis](https://github.com/jamescdavis))

## v5.3.0 (2020-08-10)

#### :rocket: Enhancement
* [#597](https://github.com/ember-cli/ember-cli-htmlbars/pull/597) Pass `isProduction` to Ember template compiler. ([@rwjblue](https://github.com/rwjblue))

#### :memo: Documentation
* [#585](https://github.com/ember-cli/ember-cli-htmlbars/pull/585) Refactor README ([@rwjblue](https://github.com/rwjblue))

#### :house: Internal
* [#584](https://github.com/ember-cli/ember-cli-htmlbars/pull/584) Replace `ember-cli-template-lint` with `ember-template-lint` ([@arthirm](https://github.com/arthirm))

#### Committers: 2
- Arthi ([@arthirm](https://github.com/arthirm))
- Robert Jackson ([@rwjblue](https://github.com/rwjblue))


## v5.2.0 (2020-06-25)

#### :rocket: Enhancement
* [#527](https://github.com/ember-cli/ember-cli-htmlbars/pull/527) Move template compiler creation to a method on the addon ([@chriseppstein](https://github.com/chriseppstein))

#### Committers: 1
- Chris Eppstein ([@chriseppstein](https://github.com/chriseppstein))


## v5.1.2 (2020-05-08)

#### :bug: Bug Fix
* [#553](https://github.com/ember-cli/ember-cli-htmlbars/pull/553) Ensure custom templateCompilerPath is an absolute path. ([@rwjblue](https://github.com/rwjblue))

#### Committers: 1
- Robert Jackson ([@rwjblue](https://github.com/rwjblue))


## v5.1.1 (2020-05-07)

#### :bug: Bug Fix
* [#551](https://github.com/ember-cli/ember-cli-htmlbars/pull/551) Ensure `EmberENV` is available to inline template compilation ([@rwjblue](https://github.com/rwjblue))
* [#550](https://github.com/ember-cli/ember-cli-htmlbars/pull/550) Fix specifying custom template compiler path. ([@rwjblue](https://github.com/rwjblue))

#### :house: Internal
* [#547](https://github.com/ember-cli/ember-cli-htmlbars/pull/547) Add some more helpful debug logging to list AST plugins ([@rwjblue](https://github.com/rwjblue))
* [#544](https://github.com/ember-cli/ember-cli-htmlbars/pull/544) Add Node 14 to CI ([@rwjblue](https://github.com/rwjblue))

#### Committers: 1
- Robert Jackson ([@rwjblue](https://github.com/rwjblue))


## v5.1.0 (2020-05-06)

#### :rocket: Enhancement
* [#543](https://github.com/ember-cli/ember-cli-htmlbars/pull/543) Update babel-plugin-htmlbars-inline-precompile to 4.0.0. ([@rwjblue](https://github.com/rwjblue))

#### Committers: 1
- Robert Jackson ([@rwjblue](https://github.com/rwjblue))


## v5.0.0 (2020-05-04)

#### :boom: Breaking Change
* [#496](https://github.com/ember-cli/ember-cli-htmlbars/pull/496) Drop support for Ember < 3.8. ([@rwjblue](https://github.com/rwjblue))
* [#493](https://github.com/ember-cli/ember-cli-htmlbars/pull/493) Drop Node 8 support. ([@rwjblue](https://github.com/rwjblue))
* [#492](https://github.com/ember-cli/ember-cli-htmlbars/pull/492) Remove Bower support. ([@rwjblue](https://github.com/rwjblue))

#### :rocket: Enhancement
* [#528](https://github.com/ember-cli/ember-cli-htmlbars/pull/528) Use smaller cache key for `ember-template-compiler` (reduce overall memory overhead of caching) ([@xg-wang](https://github.com/xg-wang))
* [#512](https://github.com/ember-cli/ember-cli-htmlbars/pull/512) Update Broccoli dependencies to latest. ([@rwjblue](https://github.com/rwjblue))

#### :house: Internal
* [#514](https://github.com/ember-cli/ember-cli-htmlbars/pull/514) Update fixturify and qunit-dom to latest. ([@rwjblue](https://github.com/rwjblue))
* [#513](https://github.com/ember-cli/ember-cli-htmlbars/pull/513) Update semver to 7.1.2. ([@rwjblue](https://github.com/rwjblue))
* [#508](https://github.com/ember-cli/ember-cli-htmlbars/pull/508) Update to prettier@2. ([@rwjblue](https://github.com/rwjblue))
* [#507](https://github.com/ember-cli/ember-cli-htmlbars/pull/507) Update Babel related devDependencies. ([@rwjblue](https://github.com/rwjblue))

#### Committers: 2
- Robert Jackson ([@rwjblue](https://github.com/rwjblue))
- Thomas Wang ([@xg-wang](https://github.com/xg-wang))


## v4.3.1 (2020-04-09)

#### :bug: Bug Fix
126 changes: 87 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,78 @@
# Ember CLI HTMLBars

<a href="https://github.com/ember-cli/ember-cli-htmlbars/actions"><img alt="Build Status" src="https://github.com/ember-cli/ember-cli-htmlbars/workflows/ci/badge.svg"></a>
<a href="https://github.com/ember-cli/ember-cli-htmlbars/actions"><img alt="Build Status" src="https://github.com/ember-cli/ember-cli-htmlbars/workflows/CI/badge.svg"></a>

### Registering a Plugin
## Compatibility

```javascript
* Ember.js v3.8 or above
* Ember CLI v3.8 or above
* Node.js v10 or above

## Tagged Template Usage / Migrating from `htmlbars-inline-precompile`

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)

This will require an update to the imports of the `hbs` helper in your tests:

Prior syntax:

```
import hbs from 'htmlbars-inline-precompile';
...
await render(hbs`
<MyComponent />
`);
```

New syntax:

```
import { hbs } from 'ember-cli-htmlbars';
...
await render(hbs`
<MyComponent />
`);
```

There is a [codemod](https://github.com/ember-codemods/ember-cli-htmlbars-inline-precompile-codemod) available to automate this change.

## Additional Trees

For addons which want additional customizations, they are able to interact with
this addon directly.

```ts
interface EmberCLIHTMLBars {
/**
Supports easier transpilation of non-standard input paths (e.g. to transpile
a non-addon NPM dependency) while still leveraging the logic within
ember-cli-htmlbars for transpiling (e.g. custom AST transforms, colocation, etc).
*/
transpileTree(inputTree: BroccoliTree): BroccoliTree;
}
```

### `transpileTree` usage

```js
// find the ember-cli-htmlbars addon
let htmlbarsAddon = this.addons.find(addon => addon.name === 'ember-cli-htmlbars');

// invoke .transpileTree passing in the custom input tree
let transpiledCustomTree = htmlbarsAddon.transpileTree(someCustomTree);
```

## Adding Custom Plugins

You can add custom plugins to be used during transpilation of the `addon/` or
`addon-test-support/` trees of your addon (or the `app/` and `tests/` trees of an application)
by registering a custom AST transform.

```js
var SomeTransform = require('./some-path/transform');

module.exports = {
@@ -22,15 +90,15 @@ module.exports = {
};
```

#### Options for registering a `htmlbars-ast-plugin`
### Options for registering a plugin

* `name` - String. The name of the AST transform for debugging purposes.
* `plugin` - A function of type [`ASTPluginBuilder`](https://github.com/glimmerjs/glimmer-vm/blob/master/packages/%40glimmer/syntax/lib/parser/tokenizer-event-handlers.ts#L329-L341).
* `dependencyInvalidation` - Boolean. A flag that indicates the AST Plugin may, on a per-template basis, depend on other files that affect its output.
* `cacheKey` - function that returns any JSON-compatible value - The value returned is used to invalidate the persistent cache across restarts, usually in the case of a dependency or configuration change.
* `baseDir` - `() => string`. A function that returns the directory on disk of the npm module for the plugin. If provided, a basic cache invalidation is performed if any of the dependencies change (e.g. due to a npm install/upgrade).

#### Implementing Dependency Invalidation in an AST Plugin
### Implementing Dependency Invalidation in an AST Plugin

Plugins that set the `dependencyInvalidation` option to `true` can provide function for the `plugin` of type `ASTDependencyPlugin` as given below.

@@ -71,7 +139,7 @@ export interface ASTPluginWithDeps extends ASTPlugin {
}
```

### Precompile HTMLBars template strings within other addons
## Precompile HTMLBars template strings within other addons

```javascript
module.exports = {
@@ -93,44 +161,24 @@ module.exports = {
};
```

### Tagged Template Usage / Migrating from `htmlbars-inline-precompile`
### Custom Template Compiler

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)
You can still provide a custom path to the template compiler (e.g. to test
custom template compiler tweaks in an application) by:

This will require an update to the imports of the `hbs` helper in your tests:
```js
// ember-cli-build.js

Prior syntax:

```
import hbs from 'htmlbars-inline-precompile';
...
await render(hbs`
<MyComponent />
`);
```

New syntax:

```
import { hbs } from 'ember-cli-htmlbars';
...
await render(hbs`
<MyComponent />
`);
module.exports = function(defaults) {
let app = new EmberApp(defaults, {
'ember-cli-htmlbars': {
templateCompilerPath: `some_path/to/ember-template-compiler.js`,
}
});
};
```

There is a [codemod](https://github.com/ember-codemods/ember-cli-htmlbars-inline-precompile-codemod) available to automate this change.

### Handlebars 2.0 Support (Ember < 1.10)

Handlebars 2.0 support has been removed. If you are using ember-cli-htmlbars with a 1.9.x project please continue
to use ember-cli-htmlbars@0.6.x.

### Using as a Broccoli Plugin
## Using as a Broccoli Plugin

```javascript
var HtmlbarsCompiler = require('ember-cli-htmlbars');
18 changes: 10 additions & 8 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ have been merged since the last release have been labeled with the appropriate
represent something that would make sense to our users. Some great information
on why this is important can be found at
[keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall
guiding principles here is that changelogs are for humans, not machines.
guiding principle here is that changelogs are for humans, not machines.

When reviewing merged PR's the labels to be used are:

@@ -47,19 +47,21 @@ npm install --global release-it
* Second, ensure that you have installed your projects dependencies:

```
# using yarn
yarn install
# using npm
npm install
```

* And last (but not least 😁) do your release:
* And last (but not least 😁) do your release. It requires a
[GitHub personal access token](https://github.com/settings/tokens) as
`$GITHUB_AUTH` environment variable. Only "repo" access is needed; no "admin"
or other scopes are required.

```
export GITHUB_AUTH="f941e0..."
release-it
```

[release-it](https://github.com/release-it/release-it/) manages the actual
release process. It will prompt you through the process of choosing the version
number, tagging, pushing the tag and commits, etc.
release process. It will prompt you to to choose the version number after which
you will have the chance to hand tweak the changelog to be used (for the
`CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
pushing the tag and commits, etc.
Loading