diff --git a/.release-plan.json b/.release-plan.json index 4b17b0227..bdd67af6b 100644 --- a/.release-plan.json +++ b/.release-plan.json @@ -1,7 +1,16 @@ { "solution": { "@embroider/addon-dev": { - "oldVersion": "4.1.2" + "impact": "patch", + "oldVersion": "4.1.2", + "newVersion": "4.1.3", + "constraints": [ + { + "impact": "patch", + "reason": "Appears in changelog section :bug: Bug Fix" + } + ], + "pkgJSONPath": "./packages/addon-dev/package.json" }, "@embroider/addon-shim": { "oldVersion": "1.8.7" @@ -10,53 +19,57 @@ "oldVersion": "3.1.1" }, "@embroider/compat": { - "impact": "minor", - "oldVersion": "3.3.1", - "newVersion": "3.4.0", + "impact": "patch", + "oldVersion": "3.4.0", + "newVersion": "3.4.1", "constraints": [ { - "impact": "minor", - "reason": "Appears in changelog section :rocket: Enhancement" + "impact": "patch", + "reason": "Has dependency `workspace:*` on @embroider/macros" + }, + { + "impact": "patch", + "reason": "Appears in changelog section :bug: Bug Fix" } ], - "pkgJSONPath": "packages/compat/package.json" + "pkgJSONPath": "./packages/compat/package.json" }, "@embroider/core": { - "oldVersion": "3.4.2" + "impact": "patch", + "oldVersion": "3.4.2", + "newVersion": "3.4.3", + "constraints": [ + { + "impact": "patch", + "reason": "Has dependency `workspace:*` on @embroider/macros" + } + ], + "pkgJSONPath": "./packages/core/package.json" }, "@embroider/hbs-loader": { "oldVersion": "3.0.3" }, "@embroider/macros": { - "oldVersion": "1.13.3" - }, - "@embroider/reverse-exports": { - "impact": "minor", - "oldVersion": "0.0.0", - "newVersion": "0.1.0", + "impact": "patch", + "oldVersion": "1.13.3", + "newVersion": "1.13.4", "constraints": [ { - "impact": "minor", - "reason": "Appears in changelog section :rocket: Enhancement" + "impact": "patch", + "reason": "Appears in changelog section :bug: Bug Fix" }, { "impact": "patch", - "reason": "Appears in changelog section :bug: Bug Fix" + "reason": "Appears in changelog section :house: Internal" } ], - "pkgJSONPath": "packages/reverse-exports/package.json" + "pkgJSONPath": "./packages/macros/package.json" + }, + "@embroider/reverse-exports": { + "oldVersion": "0.1.0" }, "@embroider/router": { - "impact": "patch", - "oldVersion": "2.1.5", - "newVersion": "2.1.6", - "constraints": [ - { - "impact": "patch", - "reason": "Appears in changelog section :bug: Bug Fix" - } - ], - "pkgJSONPath": "packages/router/package.json" + "oldVersion": "2.1.6" }, "@embroider/shared-internals": { "oldVersion": "2.5.1" @@ -74,5 +87,5 @@ "oldVersion": "3.2.1" } }, - "description": "## Release (2023-11-28)\n\n@embroider/compat 3.4.0 (minor)\n@embroider/reverse-exports 0.1.0 (minor)\n@embroider/router 2.1.6 (patch)\n\n#### :rocket: Enhancement\n* `reverse-exports`\n * [#1652](https://github.com/embroider-build/embroider/pull/1652) create new @embroider/reverse-exports package ([@lolmaus](https://github.com/lolmaus))\n* `compat`\n * [#1673](https://github.com/embroider-build/embroider/pull/1673) allow apps to disable the decorator transforms ([@ef4](https://github.com/ef4))\n\n#### :bug: Bug Fix\n* `router`\n * [#1684](https://github.com/embroider-build/embroider/pull/1684) Workaround typescript regression in router package ([@ef4](https://github.com/ef4))\n* `reverse-exports`\n * [#1676](https://github.com/embroider-build/embroider/pull/1676) fix single asterisk replacement in reverse-exports ([@mansona](https://github.com/mansona))\n\n#### :house: Internal\n* [#1683](https://github.com/embroider-build/embroider/pull/1683) update the releasing CI job ([@mansona](https://github.com/mansona))\n* [#1681](https://github.com/embroider-build/embroider/pull/1681) skip watch-mode tests in windows ([@mansona](https://github.com/mansona))\n\n#### Committers: 3\n- Andrey Mikhaylov (lolmaus) ([@lolmaus](https://github.com/lolmaus))\n- Chris Manson ([@mansona](https://github.com/mansona))\n- Edward Faulkner ([@ef4](https://github.com/ef4))\n" + "description": "## Release (2023-12-13)\n\n@embroider/addon-dev 4.1.3 (patch)\n@embroider/compat 3.4.1 (patch)\n@embroider/core 3.4.3 (patch)\n@embroider/macros 1.13.4 (patch)\n\n#### :bug: Bug Fix\n* `@embroider/macros`\n * [#1688](https://github.com/embroider-build/embroider/pull/1688) Fix branch elimination for `macroDependencySatisfies` ([@mike-engel](https://github.com/mike-engel))\n* `@embroider/compat`\n * [#1706](https://github.com/embroider-build/embroider/pull/1706) Support engine's lazyLoading boolean config ([@fengb](https://github.com/fengb))\n* `@embroider/addon-dev`\n * [#1696](https://github.com/embroider-build/embroider/pull/1696) Use rollup's `addWatchFile` API to mark dependencies ([@chancancode](https://github.com/chancancode))\n\n#### :house: Internal\n* Other\n * [#1716](https://github.com/embroider-build/embroider/pull/1716) update release-plan ([@mansona](https://github.com/mansona))\n * [#1698](https://github.com/embroider-build/embroider/pull/1698) Use release plan ([@mansona](https://github.com/mansona))\n* `@embroider/macros`\n * [#1709](https://github.com/embroider-build/embroider/pull/1709) Jest types broke our CI ([@ef4](https://github.com/ef4))\n* `@embroider/test-scenarios`\n * [#1705](https://github.com/embroider-build/embroider/pull/1705) Backport #1703 to stable ([@chancancode](https://github.com/chancancode))\n\n#### Committers: 5\n- Benjamin Feng ([@fengb](https://github.com/fengb))\n- Chris Manson ([@mansona](https://github.com/mansona))\n- Edward Faulkner ([@ef4](https://github.com/ef4))\n- Godfrey Chan ([@chancancode](https://github.com/chancancode))\n- Mike Engel ([@mike-engel](https://github.com/mike-engel))\n" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e591b5eb..cfe5bd66d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,34 @@ # Embroider Changelog +## Release (2023-12-13) + +@embroider/addon-dev 4.1.3 (patch) +@embroider/compat 3.4.1 (patch) +@embroider/core 3.4.3 (patch) +@embroider/macros 1.13.4 (patch) + +#### :bug: Bug Fix +* `@embroider/macros` + * [#1688](https://github.com/embroider-build/embroider/pull/1688) Fix branch elimination for `macroDependencySatisfies` ([@mike-engel](https://github.com/mike-engel)) +* `@embroider/compat` + * [#1706](https://github.com/embroider-build/embroider/pull/1706) Support engine's lazyLoading boolean config ([@fengb](https://github.com/fengb)) +* `@embroider/addon-dev` + * [#1696](https://github.com/embroider-build/embroider/pull/1696) Use rollup's `addWatchFile` API to mark dependencies ([@chancancode](https://github.com/chancancode)) + +#### :house: Internal +* Other + * [#1716](https://github.com/embroider-build/embroider/pull/1716) update release-plan ([@mansona](https://github.com/mansona)) + * [#1698](https://github.com/embroider-build/embroider/pull/1698) Use release plan ([@mansona](https://github.com/mansona)) +* `@embroider/macros` + * [#1709](https://github.com/embroider-build/embroider/pull/1709) Jest types broke our CI ([@ef4](https://github.com/ef4)) +* `@embroider/test-scenarios` + * [#1705](https://github.com/embroider-build/embroider/pull/1705) Backport #1703 to stable ([@chancancode](https://github.com/chancancode)) + +#### Committers: 5 +- Benjamin Feng ([@fengb](https://github.com/fengb)) +- Chris Manson ([@mansona](https://github.com/mansona)) +- Edward Faulkner ([@ef4](https://github.com/ef4)) +- Godfrey Chan ([@chancancode](https://github.com/chancancode)) +- Mike Engel ([@mike-engel](https://github.com/mike-engel)) ## Release (2023-11-28) diff --git a/packages/addon-dev/package.json b/packages/addon-dev/package.json index 9566186e2..add371a13 100644 --- a/packages/addon-dev/package.json +++ b/packages/addon-dev/package.json @@ -1,6 +1,6 @@ { "name": "@embroider/addon-dev", - "version": "4.1.2", + "version": "4.1.3", "description": "Utilities for addon authors", "repository": { "type": "git", diff --git a/packages/compat/package.json b/packages/compat/package.json index 9ec3ac427..cbd6ac329 100644 --- a/packages/compat/package.json +++ b/packages/compat/package.json @@ -1,6 +1,6 @@ { "name": "@embroider/compat", - "version": "3.4.0", + "version": "3.4.1", "private": false, "description": "Backward compatibility layer for the Embroider build system.", "repository": { diff --git a/packages/compat/src/compat-adapters/ember-source.ts b/packages/compat/src/compat-adapters/ember-source.ts index 1bebb47c2..f2187269c 100644 --- a/packages/compat/src/compat-adapters/ember-source.ts +++ b/packages/compat/src/compat-adapters/ember-source.ts @@ -124,11 +124,16 @@ export default class extends V1Addon { meta['implicit-modules'] = []; } meta['implicit-modules'].push('./ember/index.js'); - - if (!meta['implicit-test-modules']) { - meta['implicit-test-modules'] = []; + // before 5.6, Ember uses the AMD loader to decide if it's test-only parts + // are present, so we must ensure they're registered. After that it's + // enough to evaluate ember-testing, which @embroider/core is hard-coded + // to do in the backward-compatible tests bundle. + if (!satisfies(this.packageJSON.version, '>= 5.6.0-alpha.0', { includePrerelease: true })) { + if (!meta['implicit-test-modules']) { + meta['implicit-test-modules'] = []; + } + meta['implicit-test-modules'].push('./ember-testing/index.js'); } - meta['implicit-test-modules'].push('./ember-testing/index.js'); } return meta; } diff --git a/packages/compat/src/compat-app-builder.ts b/packages/compat/src/compat-app-builder.ts index 01183e2cf..2344961b5 100644 --- a/packages/compat/src/compat-app-builder.ts +++ b/packages/compat/src/compat-app-builder.ts @@ -1346,6 +1346,7 @@ export class CompatAppBuilder { // packagers to understand. It's better to express it here as a direct // module dependency. let eagerModules: string[] = [ + 'ember-testing', explicitRelative(dirname(myName), this.topAppJSAsset(appFiles, prepared).relativePath), ]; diff --git a/packages/core/package.json b/packages/core/package.json index 57230a432..a6f006098 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@embroider/core", - "version": "3.4.2", + "version": "3.4.3", "private": false, "description": "A build system for EmberJS applications.", "repository": { diff --git a/packages/macros/package.json b/packages/macros/package.json index e499353ed..5b438d9c7 100644 --- a/packages/macros/package.json +++ b/packages/macros/package.json @@ -1,6 +1,6 @@ { "name": "@embroider/macros", - "version": "1.13.3", + "version": "1.13.4", "private": false, "description": "Standardized build-time macros for ember apps.", "keywords": [ diff --git a/packages/macros/src/glimmer/ast-transform.ts b/packages/macros/src/glimmer/ast-transform.ts index b7d0a3aa9..8fb071e96 100644 --- a/packages/macros/src/glimmer/ast-transform.ts +++ b/packages/macros/src/glimmer/ast-transform.ts @@ -77,7 +77,7 @@ export function makeFirstTransform(opts: FirstTransformParams) { } }, }, - SubExpression(node: any) { + SubExpression(node: any, walker: { parent: { node: any } }) { if (node.path.type !== 'PathExpression') { return; } @@ -97,7 +97,16 @@ export function makeFirstTransform(opts: FirstTransformParams) { ); } if (node.path.original === 'macroDependencySatisfies') { - return literal(dependencySatisfies(node, opts.packageRoot, moduleName, packageCache), env.syntax.builders); + const staticValue = literal( + dependencySatisfies(node, opts.packageRoot, moduleName, packageCache), + env.syntax.builders + ); + // If this is a macro expression by itself, then turn it into a macroCondition for the second pass to prune. + // Otherwise assume it's being composed with another macro and evaluate it as a literal + if (walker.parent.node.path.original === 'if') { + return env.syntax.builders.sexpr('macroCondition', [staticValue]); + } + return staticValue; } }, MustacheStatement(node: any) { diff --git a/packages/macros/tests/glimmer/dependency-satisfies.test.ts b/packages/macros/tests/glimmer/dependency-satisfies.test.ts index e8c389dc8..0531aa520 100644 --- a/packages/macros/tests/glimmer/dependency-satisfies.test.ts +++ b/packages/macros/tests/glimmer/dependency-satisfies.test.ts @@ -29,6 +29,11 @@ describe('dependency satisfies', () => { expect(result).toMatch(/@a=\{\{true\}\}/); }); + test('in branch', () => { + let result = transform(`{{#if (macroDependencySatisfies 'qunit' '^2.8.0')}}red{{else}}blue{{/if}}`, { filename }); + expect(result).toEqual('red'); + }); + test('emits false for out-of-range package', () => { let result = transform(`{{macroDependencySatisfies 'qunit' '^10.0.0'}}`, { filename }); expect(result).toEqual('{{false}}');