Skip to content

Commit 424a6e6

Browse files
NullVoxPopuliclaude
andcommitted
revert(ember-form): the minimum is ember-source 7.1, not 6.8
Reverts b8acc5c. The docs and the tests rely on `on`, `fn`, and `hash` in template scope, which ember-source 7.1 added. The peer range is now `>= 7.1.0`. The browser job in pr.yml runs the tests on the installed version and on 7.1.0. All 28 tests pass on both. The eslint globals for the keywords stay removed. eslint-plugin-ember 13.5 and ember-eslint-parser 0.14 know the keywords. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 15d4751 commit 424a6e6

19 files changed

Lines changed: 402 additions & 80 deletions

.github/workflows/pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ jobs:
4848
strategy:
4949
fail-fast: false
5050
matrix:
51-
# '' keeps the version in the lockfile. '~6.8.0' is the oldest supported version.
52-
ember-source: ['', '~6.8.0']
51+
# '' keeps the version in the lockfile. '~7.1.0' is the oldest supported version.
52+
ember-source: ['', '~7.1.0']
5353
steps:
5454
- name: Checkout
5555
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

docs/framework/ember/quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export default class EditProfile extends Component {
102102
- Anything shared across every instance (such as `defaultValues` or validators that don't depend on per-instance state) goes into the `createForm` call. Anything per-instance — most notably `onSubmit`, which usually closes over component state — is passed as an arg on the invocation: `<SimpleFormExample @onSubmit={{handleSubmit}}>`.
103103
- The component yields the form, named `f` in the examples above. Use it to render fields (`<f.Field>`) and to read form state (`<f.Subscribe>`). [Why not `form`?](./guides/basic-concepts.md#why-not-form) explains the names.
104104
- `onSubmitFor` is a small module-level helper that produces a `submit` handler for a given form. It's a convenient way to keep `event.preventDefault()` plumbing out of every template without re-introducing class methods.
105-
- From ember-source 7.1, templates can use `on`, `fn`, and `hash` without an import, and the examples in these docs rely on that. `@tanstack/ember-form` supports ember-source 6.8 or later. Before 7.1, import `on` from `@ember/modifier`, and import `fn` and `hash` from `@ember/helper`.
105+
- Common template built-ins like `on`, `fn`, `hash`, and `if` are compiled into scope by ember-source's template build transforms (ember-source 7+), so you don't need to import them.
106106
- `handleInput` is defined at module scope rather than as a method, so we can use the standard `(fn handleInput field)` pattern without binding `this` for every render.
107107

108108
From here, you'll be ready to explore all of the other features of TanStack Form!

packages/ember-form/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Powerful, type-safe forms for Ember, built on `@tanstack/form-core`.
44

55
## Compatibility
66

7-
- ember-source 6.8 or later
7+
- ember-source 7.1 or later
88
- gjs and gts only
99

10-
From ember-source 7.1, templates can use `on`, `fn`, and `hash` without an import, and the examples rely on that. Before 7.1, import `on` from `@ember/modifier`, and import `fn` and `hash` from `@ember/helper`.
10+
From ember-source 7.1, templates can use `on`, `fn`, and `hash` without an import.
1111

1212
## Installation
1313

@@ -114,7 +114,7 @@ pnpm test:eslint
114114

115115
`tests/types/templates.gts` holds the type tests. Each `@glint-expect-error` comment marks a template that must not type-check, and `pnpm test:types` fails if one of them does.
116116

117-
The tests import `on`, `fn`, and `hash`, because they must also compile on ember-source 6.8. CI runs them two times: on the installed version, and on 6.8.
117+
CI runs the browser tests two times: on the installed ember-source, and on 7.1, the oldest supported version.
118118

119119
In CI, the browser tests run in their own job on the GitHub runner, because the Nx agents that run the other targets have no browser.
120120

packages/ember-form/demo-app/templates/application.gts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { fn, hash } from '@ember/helper';
2-
import { on } from '@ember/modifier';
31
import Component from '@glimmer/component';
42
import { pageTitle } from 'ember-page-title';
53
import { createForm, Subscribe } from '@tanstack/ember-form';

packages/ember-form/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
},
5454
"peerDependencies": {
5555
"@glimmer/component": "^2.0.0",
56-
"ember-source": ">= 6.8.0"
56+
"ember-source": ">= 7.1.0"
5757
},
5858
"devDependencies": {
5959
"@babel/core": "^7.25.2",
@@ -72,14 +72,14 @@
7272
"@types/qunit": "^2.19.14",
7373
"@typescript-eslint/parser": "^8.0.0",
7474
"babel-plugin-ember-template-compilation": "^3.1.0",
75-
"ember-eslint-parser": "^0.5.9",
75+
"ember-eslint-parser": "^0.14.6",
7676
"ember-page-title": "^9.0.3",
7777
"ember-qunit": "^9.0.2",
7878
"ember-source": "^7.3.0",
7979
"ember-strict-application-resolver": "^0.1.0",
8080
"eslint": "9.36.0",
8181
"eslint-config-prettier": "^10.1.5",
82-
"eslint-plugin-ember": "^12.3.3",
82+
"eslint-plugin-ember": "^13.5.0",
8383
"eslint-plugin-import": "^2.31.0",
8484
"eslint-plugin-n": "^17.15.1",
8585
"globals": "^16.1.0",

packages/ember-form/tests/integration/array-field-test.gts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { fn } from '@ember/helper';
2-
import { on } from '@ember/modifier';
31
import { click, fillIn, render } from '@ember/test-helpers';
42
import { module, test } from 'qunit';
53
import { setupRenderingTest } from 'ember-qunit';

packages/ember-form/tests/integration/field-reactive-args-test.gts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { fn, hash } from '@ember/helper';
2-
import { on } from '@ember/modifier';
31
import Component from '@glimmer/component';
42
import { tracked } from '@glimmer/tracking';
53
import { click, fillIn, render } from '@ember/test-helpers';

packages/ember-form/tests/integration/field-test.gts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { fn, hash } from '@ember/helper';
2-
import { on } from '@ember/modifier';
31
import { fillIn, render } from '@ember/test-helpers';
42
import { module, test } from 'qunit';
53
import { setupRenderingTest } from 'ember-qunit';

packages/ember-form/tests/integration/field-unmount-test.gts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { fn } from '@ember/helper';
2-
import { on } from '@ember/modifier';
31
import Component from '@glimmer/component';
42
import { tracked } from '@glimmer/tracking';
53
import { click, fillIn, render } from '@ember/test-helpers';

packages/ember-form/tests/integration/field-validation-test.gts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { fn, hash } from '@ember/helper';
2-
import { on } from '@ember/modifier';
31
import { blur, fillIn, focus, render, waitFor } from '@ember/test-helpers';
42
import { module, test } from 'qunit';
53
import { setupRenderingTest } from 'ember-qunit';

0 commit comments

Comments
 (0)