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

Add support for Ember 4.8 #2397

Merged
merged 4 commits into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions packages/compat/src/compat-adapters/ember-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,10 @@ function updateFileWithTransform(
file: string,
transformFunction: Babel.PluginItem | Babel.PluginItem[]
) {
// only update the file if it exists - this helps the codemods to work across many different versions
if (!existsSync(resolve(context.inputPaths[0], file))) {
return;
}
let inSource = readFileSync(resolve(context.inputPaths[0], file), 'utf8');

let plugins = Array.isArray(transformFunction) ? transformFunction : [transformFunction];
Expand Down Expand Up @@ -464,6 +468,15 @@ class FixCycleImports extends Plugin {
path.node.source = t.stringLiteral('@ember/array/make');
path.node.specifiers = [t.importDefaultSpecifier(t.identifier('makeArray'))];
}

if (path.node.source.value === '@ember/-internals/runtime') {
path.replaceWith(
t.importDeclaration(
[t.importSpecifier(t.identifier('ActionHandler'), t.identifier('default'))],
t.stringLiteral('@ember/-internals/runtime/lib/mixins/action_handler')
)
);
}
},
},
};
Expand Down
6 changes: 3 additions & 3 deletions tests/scenarios/scenarios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ async function lts_4_4(project: Project) {

async function lts_4_8(project: Project) {
project.linkDevDependency('ember-source', { baseDir: __dirname, resolveName: 'ember-source-4.8' });
project.linkDevDependency('ember-cli', { baseDir: __dirname, resolveName: 'ember-cli-4.8' });
project.linkDevDependency('ember-data', { baseDir: __dirname, resolveName: 'ember-data-4.8' });
// ember-cli 4.12 is the earliest version that can have an async function
project.linkDevDependency('ember-cli', { baseDir: __dirname, resolveName: 'ember-cli-4.12' });
project.linkDevDependency('ember-data', { baseDir: __dirname, resolveName: 'ember-data-5.3' });
}

async function lts_4_12(project: Project) {
Expand Down Expand Up @@ -112,7 +113,6 @@ export function fullSupportMatrix(scenarios: Scenarios) {
// new vite based system is working as we like
.skip('lts_3_28')
.skip('lts_4_4')
.skip('lts_4_8')
);
}

Expand Down