Replies: 3 comments 2 replies
-
let me know if this is compelling or not. I added another demo related to this content #6419. I think that content is quite simple to test as experiment in this POC demo URL: https://preschian.xyz/blog |
Beta Was this translation helpful? Give feedback.
-
Hello @preschian, Thanks for the deep dive in to the topic and possible solution of using proxy.
I am aware that we not longer, use vuex, majority of components are written in composition api |
Beta Was this translation helpful? Give feedback.
-
I think we can close this POC for now. The problem was we couldn't use the latest nuxt-bridge to make a smooth migration
|
Beta Was this translation helpful? Give feedback.
-
Hi everyone! @kodadot/internal-dev I want to share my POC results for migrating our app to Nuxt3 within the proxy. We are currently in the middle of migrating to Nuxt3, and you can see the roadmap here: #2690 (comment). However, what if we could migrate our app to Nuxt3 directly using a shortcut?
One challenge I faced with the current migration is that I am not sure if the upgraded dependencies are compatible with
nuxt-bridge/nuxt3
, and there is a possibility that it may not go smoothly. Last time I checked, some dependencies were not supported onnuxt-bridge
.Based on this documentation: https://nuxt.com/docs/bridge/overview#install-nuxt-bridge, I assumed that
nuxt-bridge
should be using the latest version. However, we are stuck in the current version, and it will throw errors in the latest version (https://github.com/preschian/nft-gallery/pull/86/files#diff-65d5d69bb59dcc81ad971719549cdee5018f0a240add8b7ef5c65bee3e73dae0R29). I have already tried testing with enable/disable auto-import, but it was unsuccessful.So, last week, I tried to find another workaround to deliver Nuxt3. I tested a small POC to proxy our app with Nuxt3. You can test it here:
Alternatively, you can directly visit this link: https://preschian.xyz/rmrk/u/CocvTCrHM2bcLGNFTVGd71AuvVPFVPbJknDiLJAmNEAfLzi
The
/rmrk/u/*
path has been proxied to use the Nuxt3 app. The other routes still use Nuxt2.Here is the code:
To do this:
cf-workers
to accomplish thisPros:
Cons:
Limitations
1. Issue with Using pnpm Workspaces
Because
nft-gallery
is the primary repository, attempting to put a Nuxt3 app in the same repository would conflict with thenuxi
content if they were placed alongside the Nuxt2 app.Workarounds:
nft-gallery
without pnpm workspaces, which requires installing dependencies usingnpm install
.npm install
, it is still necessary to removenode_modules
in the root folders before development, usingrm -rf ../../node_modules
.Alternative solution:
2. Issue with Deploying Multiple Pages in Cloudflare Pages Using a Single Repository
Unfortunately not supported. ref: https://community.cloudflare.com/t/several-pages-from-same-repo/434705
Workarounds:
A mirroring repository was created to connect and deploy Nuxt3 to Cloudflare Pages: feat: gradually migrate nuxt 3 preschian/nft-gallery-mirror#1wrangler cli
. Need to pass some ENV first. [Commands](https://github.com/preschian/nft-gallery/blob/f1f43e62f296eccda9d82cd22a8958a9353b0060/apps/marketplace/package.json#L10):NITRO_PRESET=cloudflare-pages
NUXT_APP_CDN_URL=https://marketplace-nuxt3.pages.dev/ npm run build
wrangler pages publish dist/
Alternative solution:
Deploy Nuxt3 withwrangler cli
. This method was attempted but was still unsuccessful in deploying the SSR app.3. Unable to use
<NuxtLink />
By default,
<NuxtLink />
navigates to the page on the client side. However, our proxy is only on the server side with cf-workers.Workarounds:
<a href="/page" />
instead of<NuxtLink to="/page" />
to navigate to the Nuxt3 app.Alternative solution:
<NuxtLink />
that can disable client-side navigation.4. Unable to usepublic
folder or compiled css (yet)Workarounds:
Use full path assets:<img src="<https://domain.xyz/public/logo.svg>" />
NUXT_APP_CDN_URL
Alternative solution:
NuxtImage
module for images: https://image.nuxtjs.org/providers/cloudflarePlease note, there might be another limitation that is still not discovered yet.
Alternative Methods
1. Without Proxy
We can use another subdomain for the Nuxt3 app, for example
next.kodadot.xyz
. However, we should release it to the user only once most of the crucial pages are ready.Pros: Smaller limitations.
Cons: Takes longer to deliver to the user.
Document updates:
wrangler cli
NUXT_APP_CDN_URL
Beta Was this translation helpful? Give feedback.
All reactions