As mentioned in previous discussions, I’ve tried to use OpenAI and more specific Codex (i.e. OpenAI cli) to migrate Aurelia1 + webpack to Aurelia2 (beta-27) + Vite.
My thoughts are, when the migration documentation is complete, the AI should be smart enough to perform the update. So I fed Codex with the links to the migration documents, and let it run.
Unfortunately I don’t have the original prompt… Codex history does not properly support multi-session it seems…
But this was kind of what I told Codex to do:
› GOAL: migrate all AU1+webpack code from the /source folder to AU2+vite.
Step by step actions:
* Use the documentation with regards to the migration:
- https://docs.aurelia.io/migrating-to-aurelia-2/migrating-to-aurelia-2
- https://docs.aurelia.io/migrating-to-aurelia-2/migrating-to-aurelia-2/side-by-side-comparison
* Use the checklist https://docs.aurelia.io/migrating-to-aurelia-2/migrating-to-aurelia-2/side-by-side-comparison#migration-checklist as base steps
* all separate steps need to be followed by a commit.
* Use Beta-27 as base version to work towards, see https://aurelia.io/blog/2025/12/29/aurelia-beta-27/ for extra info.
* only summarize output
Runtime about 2h. The commits by Codex give an interesting insight in what it has tried:
chore: add AU1 ui-vite snapshot for AU2 migration POC
chore(au2): update HTML entry point for AU2 root
chore(au2): rewrite main bootstrapping for Aurelia 2
chore(au2): move dependencies to Aurelia 2 beta.27
chore(au2): add Vite bundler setup for AU2
chore(au2): tighten TypeScript config for AU2
chore(au2): switch template requires to imports
chore(au2): drop root template wrappers
chore(au2): align App lifecycle hooks with AU2
chore(au2): rely on convention-based stylesheet loading
chore(au2): modernize custom element/attribute decorators
chore(au2): replace ternary class bindings with .class
chore(au2): remove computedFrom decorators
chore(au2): add lambda expression demo in templates
chore(au2): update value converters and binding behaviors
chore(au2): switch routing config to @route definitions
chore(au2): rename route lifecycle hooks to canLoad/loading
chore(au2): swap router-view for au-viewport
chore(au2): add route param handling smoke check
chore(au2): adapt router guards to AU2 hook API
chore(au2): remove autoinject usage
chore(au2): register services via Registration API
chore(au2): add DI interface token for EntityFactory
chore(au2): switch lazy resolver to AU2 helper
chore(au2): add DI smoke coverage
chore(au2): configure LoggerConfiguration
chore(au2): add logging sink for warn/error
chore(au2): use ILogger for download executor
chore(au2): add logging sink smoke test
chore(au2): add template binding smoke section
chore(au2): add custom element/attribute smoke section
chore(au2): add template controller smoke
chore(au2): add value converter smoke examples
chore(au2): add event binding smoke section
chore(au2): update jest pretest for AU2
chore(au2): refresh component test fixture setup
chore(au2): add lifecycle hook smoke test
chore(au2): update DI usage in unit tests
chore(au2): update e2e smoke for Vite shell
chore(au2): add Shadow DOM demo component
chore(au2): add custom attribute pattern
chore(au2): add minimal state store
chore(au2): add watch decorator smoke
After this first set of changes, Vite was not able to build. I’ve performed some extra changes:
- There was an issue with @aurelia/i18n at that time, but that might have been temporary
- Not all PLATFORM.moduleName instances were removed, only those from the router had been changed.
Probably because in the migration documentation only a router example was added:
Migrating to Aurelia 2 | The Aurelia 2 Docs
Since still not everything was working, I tried to run again with a clean context and a little bit extra info in the prompt.
› GOAL: migrate all AU1+webpack code from the /source folder to AU2+vite.
Step by step actions:
* Read the Aurelia2 documentation, https://docs.aurelia.io/, specifically the documentation with regards to the migration:
- https://docs.aurelia.io/migrating-to-aurelia-2/migrating-to-aurelia-2
- https://docs.aurelia.io/migrating-to-aurelia-2/migrating-to-aurelia-2/side-by-side-comparison
- https://docs.aurelia.io/migrating-to-aurelia-2/cheat-sheet
* Use the checklist https://docs.aurelia.io/migrating-to-aurelia-2/migrating-to-aurelia-2/side-by-side-comparison#migration-checklist as base steps
* all separate steps need to be followed by a commit.
* Use Beta-27 as base version to work towards, see https://aurelia.io/blog/2025/12/29/aurelia-beta-27/ for extra info.
Unfortunately I forgot to add the summarize output the second run. This caused the available context to get used way faster. Codex has the option to /compact, and does perform that action runtime too.
The resulting summary by Codex of the second run:
• Migrated v1 service usage to AU2/compat and wired compat + dialog config into app startup, while switching dialog opens/settings and task queue usage to AU2 equivalents. Updated bindings to use @aurelia/compat-v1 BindingEngine,
replaced TaskQueue with queueTask, and moved dialog APIs to @aurelia/dialog with component-based open calls and options-based settings. Added new dependencies and registrations.
Details and touchpoints:
- Dialog migration + settings/options: ui-vite/src/_components/dialogs-ux/confirmation/common/cd-confirmation-dialog.ts, ui-vite/src/_components/dialogs-ux/iframe/cd-iframe-dialog.ts, ui-vite/src/_components/dialogs-ux/multi-edit/
edit-metadata-dialog/bs-edit-metadata.ts, ui-vite/src/core/aurelia/i-dialog-lifecycle.ts, ui-vite/src/core/services/templating/overlay/object-types/overlay-component-interface.ts.
- Dialog opens now use component: ui-vite/src/core/services/download/link-downloader.ts, ui-vite/src/core/services/actions/action-initiators/select-action-initiator.ts, ui-vite/src/core/services/actions/action-initiators/download-
action-initiator.ts, ui-vite/src/core/services/actions/action-executors/write-action-executor.ts, ui-vite/src/pages/permalink/permalink-page.ts, ui-vite/src/views/dashboard/widgets/quick-links/url-widget.ts.
- BindingEngine reverted to compat API and collection observer adjusted for AU2 IndexMap: ui-vite/src/_components/stories/video-studio/_components/video-preview-section.ts (plus many BindingEngine import/update sites).
- Bootstrapping + deps: ui-vite/src/main.ts, ui-vite/package.json.
With next steps proposed:
- Proceed to template migration (.delegate/.call, , etc) per checklist.
- Sweep remaining aurelia-framework imports (computedFrom, Binding/View, CompositionEngine, etc).
After this stage I had the prompt available for a moment and ran this as extra command:
For a future run by Codex of this migration, write a new MIGRATION.md file within /ui-vite that contains all relevant information so the new Codex run can start quicker.
The resulting MIGRATIONS.md was very informative and contained a lot of useful information. I will anonymize it and add it to this post for future reference.
The second run my laptop crashed :S so time for the third run:
Read ui-vite/MIGRATION.md and continue with the migration of AU1 to AU2 in the ui-vite folder. Remember to commit on every relevant step, remember to update ui-vite/MIGRATION.md. Hide output if no interaction is needed.
And since the MIGRATION file contains progress as well, Codex was able to immediately continue the migration.
What I noticed from the different runs:
- PLATFORM was not updated correctly in first run
- @aurelia/dialog migration was not performed initially
- since I added the link to the blog post about beta-27, it had more context on what to change because of that.
So this last run ran for another couple of hours.