Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update stable 2024 08 30 #2090

Closed
wants to merge 52 commits into from
Closed
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
7fe1c21
resolver transform to emit imports for helper and modifiers that need…
void-mAlex Feb 17, 2024
d1fc685
added built in components
void-mAlex Feb 17, 2024
87b8604
adding coverage for direct invocation of built-ins
ef4 Feb 20, 2024
95d3284
refactoring into combined list
ef4 Feb 20, 2024
562e744
fix the ambiguous cases
ef4 Feb 20, 2024
ded054d
if it's a pure builtin without an import do nothing
void-mAlex Mar 9, 2024
213f90f
correct typo for uniqueId import path
void-mAlex Mar 14, 2024
f2cb191
WIP compatBuild replacement for running an app code through embroider…
void-mAlex Mar 14, 2024
fb168b2
Merge remote-tracking branch 'origin/stable' into template-tag-codemod
void-mAlex Apr 23, 2024
4e03cad
Merge remote-tracking branch 'origin/stable' into template-tag-codemod
void-mAlex Jul 7, 2024
e049995
Remove deprecation of path.parts[0]
mkszepp Jul 8, 2024
4b047de
Remove `path.this` deprecation
mkszepp Jul 8, 2024
82e7e62
Remove `path.data` deprecation
mkszepp Jul 8, 2024
2a47d98
Remove `path.parts.length` deprecation
mkszepp Jul 8, 2024
c037dbd
Add semver to power select with create
mkszepp Jul 14, 2024
5770075
export templateTagCodemod entry point from compat package
void-mAlex Jul 16, 2024
8d8fc32
revert resolver transform changes
void-mAlex Jul 16, 2024
3178004
Merge pull request #2047 from mkszepp/add-semver-for-eps-with-create
mansona Jul 16, 2024
49514bf
Merge pull request #2033 from mkszepp/remove-deprecations-in-resolver
mansona Jul 16, 2024
f063ea2
Prepare Release using 'release-plan'
mansona Jul 16, 2024
ae1f07e
Merge pull request #2014 from embroider-build/release-preview-stable
mansona Jul 16, 2024
8fe8e8d
handle templateOnly components
void-mAlex Jul 16, 2024
5cb2df7
add basic test for template-tag-codemod
mansona Jul 16, 2024
2a95c0f
remove un-needed template only import
void-mAlex Jul 16, 2024
53eab6c
check template only tests passes
void-mAlex Jul 16, 2024
bbcab0a
revert lock file changes
void-mAlex Jul 16, 2024
6518cb6
pattern match against windows separators as well
void-mAlex Jul 17, 2024
4c211ea
resolve babel plugins relative to embroider compat
void-mAlex Jul 18, 2024
61e75fd
Merge branch 'template-tag-codemod' of github.com:embroider-build/emb…
void-mAlex Jul 18, 2024
962bab8
declare dependency on @babel/plugin-syntax-decorators
void-mAlex Jul 18, 2024
1498c47
duplicate execute function to avoid an export from audit system
void-mAlex Jul 18, 2024
40eb106
Merge pull request #1842 from embroider-build/template-tag-codemod
void-mAlex Jul 18, 2024
bf4c795
Prepare Release using 'release-plan'
void-mAlex Jul 18, 2024
46c7684
Merge pull request #2054 from embroider-build/release-preview-stable
void-mAlex Jul 18, 2024
55e8c55
add readme entry for templateTagCodemod
void-mAlex Jul 19, 2024
90ea155
Merge pull request #2055 from embroider-build/document-codemod-usage
void-mAlex Jul 19, 2024
545951b
Set the package manager field
NullVoxPopuli Jul 25, 2024
bbdbd9a
Allow pnpm-action-setup to read from the packageManager field in CI
NullVoxPopuli Jul 25, 2024
4d3ca87
Merge pull request #2058 from embroider-build/setPackageManager
NullVoxPopuli Jul 25, 2024
d142489
pass filename option to avoid build error on component rules lookup
void-mAlex Aug 16, 2024
0b88c1f
reduce number of lookups we do for babel plugins
void-mAlex Aug 16, 2024
8e5763c
Merge pull request #2067 from embroider-build/template-tag-codemod
ef4 Aug 20, 2024
13cf735
[Stable]: Follow upstream type change from webpack
NullVoxPopuli Aug 23, 2024
4486b12
[Stable]: Follow upstream type change from webpack
NullVoxPopuli Aug 23, 2024
57f99b0
Merge pull request #2076 from embroider-build/stable-webpack-type-change
ef4 Aug 27, 2024
00e864e
Update ember-standard-modules to include @ember/renderer and @ember/-…
NullVoxPopuli Aug 23, 2024
3e8a6d8
Update ember-standard-modules.ts
NullVoxPopuli Aug 27, 2024
1b3ebb2
Merge pull request #2075 from embroider-build/update-ember-standard-m…
ef4 Aug 30, 2024
be282fc
Prepare Release using 'release-plan'
ef4 Aug 30, 2024
fae4059
Merge pull request #2056 from embroider-build/release-preview-stable
NullVoxPopuli Aug 30, 2024
22014e2
Merge remote-tracking branch 'origin/stable' into update-stable-2024-…
NullVoxPopuli Aug 30, 2024
2db234e
Fix type issues due to resolver.nodeResolve becoming async
NullVoxPopuli Aug 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,65 @@
# Embroider Changelog

## Release (2024-08-30)

@embroider/compat 3.6.1 (patch)
@embroider/core 3.4.15 (patch)
@embroider/macros 1.16.6 (patch)
@embroider/shared-internals 2.6.3 (patch)
@embroider/webpack 4.0.5 (patch)

#### :bug: Bug Fix
* `@embroider/shared-internals`
* [#2075](https://github.com/embroider-build/embroider/pull/2075) Update ember standard modules to include @ember/renderer and @ember/-internals and ember-testing ([@NullVoxPopuli](https://github.com/NullVoxPopuli))
* `@embroider/compat`
* [#2067](https://github.com/embroider-build/embroider/pull/2067) codemod fixes ([@void-mAlex](https://github.com/void-mAlex))

#### :memo: Documentation
* [#2055](https://github.com/embroider-build/embroider/pull/2055) document templateTagCodemod usage ([@void-mAlex](https://github.com/void-mAlex))

#### :house: Internal
* `@embroider/webpack`
* [#2076](https://github.com/embroider-build/embroider/pull/2076) [Stable]: Follow upstream type change from webpack ([@NullVoxPopuli](https://github.com/NullVoxPopuli))
* Other
* [#2058](https://github.com/embroider-build/embroider/pull/2058) Set the packageManager field ([@NullVoxPopuli](https://github.com/NullVoxPopuli))

#### Committers: 2
- Alex ([@void-mAlex](https://github.com/void-mAlex))
- [@NullVoxPopuli](https://github.com/NullVoxPopuli)

## Release (2024-07-18)

@embroider/compat 3.6.0 (minor)

#### :rocket: Enhancement
* `@embroider/compat`, `@embroider/test-scenarios`
* [#1842](https://github.com/embroider-build/embroider/pull/1842) [beta] template-tag code mod ([@void-mAlex](https://github.com/void-mAlex))

#### Committers: 1
- Alex ([@void-mAlex](https://github.com/void-mAlex))

## Release (2024-07-16)

@embroider/compat 3.5.7 (patch)
@embroider/util 1.13.2 (patch)

#### :bug: Bug Fix
* `@embroider/compat`
* [#2033](https://github.com/embroider-build/embroider/pull/2033) Remove deprecations warnings in resolver transform ([@mkszepp](https://github.com/mkszepp))
* [#2047](https://github.com/embroider-build/embroider/pull/2047) Add semver to power select with create ([@mkszepp](https://github.com/mkszepp))

#### :house: Internal
* `@embroider/test-scenarios`
* [#1930](https://github.com/embroider-build/embroider/pull/1930) create a smoke test for the widest possible matrix ([@mansona](https://github.com/mansona))
* Other
* [#2015](https://github.com/embroider-build/embroider/pull/2015) update github actions ([@mansona](https://github.com/mansona))
* `@embroider/util`, `@embroider/sample-transforms`, `@embroider/test-support`, `@embroider/test-scenarios`
* [#1931](https://github.com/embroider-build/embroider/pull/1931) update scenario-tester ([@mansona](https://github.com/mansona))

#### Committers: 2
- Chris Manson ([@mansona](https://github.com/mansona))
- Markus Sanin ([@mkszepp](https://github.com/mkszepp))

## Release (2024-07-03)

@embroider/compat 3.5.6 (patch)
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -117,6 +117,28 @@ return require('@embroider/compat').compatBuild(app, Webpack, {
});
```

## Template Tag Codemod

Edit `ember-cli-build.js`:
```js
return require('@embroider/compat').templateTagCodemod(app, {
shouldTransformPath: (path) => { return true; },
dryRun: true,
});
```
Run a normal ember build to transform your hbs templates into template tag single file components.
Requires optimized build (static* flags to be turned on)

### Options

* `shouldTransformPath` - allows users to filter the templates that the code mod would run on
* `dryRun` - option can be used to obtain a summary of the changed the build would perform and which files it would act upon

### Limitations

* App templates only
* `@embroider/compat` >= 3.6.0

## Compatibility

### Ember version
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -58,6 +58,7 @@
"publishConfig": {
"registry": "https://registry.npmjs.org"
},
"packageManager": "[email protected]+sha256.691fe176eea9a8a80df20e4976f3dfb44a04841ceb885638fe2a26174f81e65e",
"changelog": {
"__comment__": "Our release infrastructure relies on these exact labels. Be careful changing them.",
"labels": {
3 changes: 2 additions & 1 deletion packages/compat/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@embroider/compat",
"version": "3.5.6",
"version": "3.6.1",
"private": false,
"description": "Backward compatibility layer for the Embroider build system.",
"repository": {
@@ -25,6 +25,7 @@
"dependencies": {
"@babel/code-frame": "^7.14.5",
"@babel/core": "^7.14.5",
"@babel/plugin-syntax-decorators": "^7.24.7",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.14.5",
"@babel/preset-env": "^7.14.5",
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ import type { PackageRules } from '..';
const rules: PackageRules[] = [
{
package: 'ember-power-select-with-create',
semverRange: '<3.0.0',
components: {
'<PowerSelectWithCreate/>': {
acceptsComponentArguments: ['powerSelectComponentName', 'suggestedOptionComponent'],
1 change: 1 addition & 0 deletions packages/compat/src/index.ts
Original file line number Diff line number Diff line change
@@ -3,4 +3,5 @@ export { default as Addons } from './compat-addons';
export { default as Options, recommendedOptions } from './options';
export { default as V1Addon } from './v1-addon';
export { default as compatBuild, prebuild, PipelineOptions } from './default-pipeline';
export { default as templateTagCodemod } from './template-tag-codemod';
export { PackageRules, ModuleRules } from './dependency-rules';
56 changes: 44 additions & 12 deletions packages/compat/src/resolver-transform.ts
Original file line number Diff line number Diff line change
@@ -781,14 +781,14 @@ class TemplateResolver implements ASTPlugin {
if (node.path.type !== 'PathExpression') {
return;
}
let rootName = node.path.parts[0];
let rootName = headOf(node.path);
if (this.scopeStack.inScope(rootName, path)) {
return;
}
if (node.path.this === true) {
if (isThisHead(node.path)) {
return;
}
if (node.path.parts.length > 1) {
if (parts(node.path).length > 1) {
// paths with a dot in them (which therefore split into more than
// one "part") are classically understood by ember to be contextual
// components, which means there's nothing to resolve at this
@@ -820,10 +820,10 @@ class TemplateResolver implements ASTPlugin {
if (node.path.type !== 'PathExpression') {
return;
}
if (node.path.this === true) {
if (isThisHead(node.path)) {
return;
}
if (this.scopeStack.inScope(node.path.parts[0], path)) {
if (this.scopeStack.inScope(headOf(node.path), path)) {
return;
}
if (node.path.original === 'component' && node.params.length > 0) {
@@ -859,14 +859,14 @@ class TemplateResolver implements ASTPlugin {
if (node.path.type !== 'PathExpression') {
return;
}
let rootName = node.path.parts[0];
let rootName = headOf(node.path);
if (this.scopeStack.inScope(rootName, path)) {
return;
}
if (node.path.this === true) {
if (isThisHead(node.path)) {
return;
}
if (node.path.parts.length > 1) {
if (parts(node.path).length > 1) {
// paths with a dot in them (which therefore split into more than
// one "part") are classically understood by ember to be contextual
// components, which means there's nothing to resolve at this
@@ -921,16 +921,16 @@ class TemplateResolver implements ASTPlugin {
if (node.path.type !== 'PathExpression') {
return;
}
if (this.scopeStack.inScope(node.path.parts[0], path)) {
if (this.scopeStack.inScope(headOf(node.path), path)) {
return;
}
if (node.path.this === true) {
if (isThisHead(node.path)) {
return;
}
if (node.path.data === true) {
if (isAtHead(node.path)) {
return;
}
if (node.path.parts.length > 1) {
if (parts(node.path).length > 1) {
// paths with a dot in them (which therefore split into more than
// one "part") are classically understood by ember to be contextual
// components. With the introduction of `Template strict mode` in Ember 3.25
@@ -1161,3 +1161,35 @@ function appendArrays(objValue: any, srcValue: any) {
return objValue.concat(srcValue);
}
}

function headOf(path: any) {
if (!path) return;

return 'head' in path ? path.head.name : path.parts[0];
}

function isThisHead(path: any) {
if (!path) return;

if ('head' in path) {
return path.head.type === 'ThisHead';
}

return path.this === true;
}

function isAtHead(path: any) {
if (!path) return;

if ('head' in path) {
return path.head.type === 'AtHead';
}

return path.data === true;
}

function parts(path: any) {
if (!path) return;

return 'original' in path ? path.original.split('.') : path.parts;
}
Loading