analog
analog copied to clipboard
AnalogJS 1.0 migration guide
In the 1.0 release, the Analog Vite plugins will be published as ESM-only.
Package updates
Update vite to ^5.0.0 in the root package.json and install if on a 4.x release version
For existing Angular CLI workspaces, a few migrations will need to be made.
- Add
"type": "module"to the root package.json - Rename any
.jsfiles to.cjs, such astailwind.config.jsandpostcss.config.js - Update any builders that were previously using
@nx/viteto use@analogjs/platformequivalents.@nx/vite:build->@analogjs/platform:vite@nx/vite:dev-server->@analogjs/platform:vite-dev-server@nx/vite:test->@analogjs/platform:vitest
- Update the
rootproperty in theangular.jsonto be"."instead of""
For existing Nx workspaces with an Analog project
- Add a
package.jsonin the project root that includes{ "type": "module" }so Vite resolves it as ESM - In the
vite.config.ts, add a config for file serving to theserverconfiguration
export default defineConfig(({ mode }) => {
return {
// other config
server: {
fs: {
allow: ['.'],
},
},
});
the 1.0 release doesn't have @analogjs/trpc package.
@brandonroberts mentioned that trpc support will be moved to @spartan-ng/trpc that is maintained by @goetzrobin
currently @spartan-ng/trpc doesn't have any releases and i'm keeping @analogjs/trpc at 0.2.45 in my project for now.
is this the right way to go?
@nckirik yes, that's correct. It should still work the same as before as an independent package
Just to note, I needed to also update my vite to version 5 (it was 4 and was throwing the ESM error)
Good catch. Thanks @BaronVonPerko
@brandonroberts I can look into this.