i18n icon indicating copy to clipboard operation
i18n copied to clipboard

feat: support nuxt4

Open kazupon opened this issue 1 year ago โ€ข 6 comments

๐Ÿ”— Linked issue

#3002

โ“ Type of change

  • [ ] ๐Ÿ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • [ ] ๐Ÿž Bug fix (a non-breaking change that fixes an issue)
  • [x] ๐Ÿ‘Œ Enhancement (improving an existing functionality like performance)
  • [ ] โœจ New feature (a non-breaking change that adds functionality)
  • [ ] ๐Ÿงน Chore (updates to the build process or auxiliary tools and libraries)
  • [ ] โš ๏ธ Breaking change (fix or feature that would cause existing functionality to change)

๐Ÿ“š Description

๐Ÿ“ Checklist

  • [x] I have linked an issue or discussion.
  • [ ] I have added tests (if possible).
  • [ ] I have updated the documentation accordingly.

kazupon avatar Jul 02 '24 06:07 kazupon

Hmm ๐Ÿค” This is strange... rollup v4.18 could not import resources in relative paths... https://github.com/nuxt-modules/i18n/actions/runs/9775263922/job/26985312555#step:11:2032

kazupon avatar Jul 03 '24 09:07 kazupon

I've added console.log on unplugin-vue-i18n. I've faced the below log:

resolveId ../../../layers/layer-server/app/locales/en.json5 /path/to/Projects/oss/nuxt/i18n/specs/fixtures/basic_usage/.nuxt/___basic_usage_spec_ts/i18n.options.mjs
resolveId ../../../layers/layer-server/app/locales/en.json5 /path/to/Projects/oss/nuxt/i18n/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@types+no_3dkmkqqbk22rzp2kskenwj4dky/node_modules/nuxt-nightly

I can't understand why en.json5 is importing from nuxt-nightly. ๐Ÿ˜…

kazupon avatar Jul 03 '24 09:07 kazupon

I've added console.log on unplugin-vue-i18n. I've faced the below log:

resolveId ../../../layers/layer-server/app/locales/en.json5 /path/to/Projects/oss/nuxt/i18n/specs/fixtures/basic_usage/.nuxt/___basic_usage_spec_ts/i18n.options.mjs
resolveId ../../../layers/layer-server/app/locales/en.json5 /path/to/Projects/oss/nuxt/i18n/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@types+no_3dkmkqqbk22rzp2kskenwj4dky/node_modules/nuxt-nightly

I can't understand why en.json5 is importing from nuxt-nightly. ๐Ÿ˜…

This is due to the folder structure changes in Nuxt 4, I have changed the fixture configurations to use the same structure as Nuxt 3 did using the example shown here.

The tests will still fail due to other factors, which should be resolved with https://github.com/nuxt-modules/i18n/pull/3015. I made a branch that's rebased on that PR (and main) to demonstrate here: https://github.com/BobbieGoede/i18n/pull/46.

BobbieGoede avatar Jul 05 '24 11:07 BobbieGoede

@kazupon I have updated/rebased this branch, it looks like it's mostly working except for the nested fixtures.. All fixtures inside specs/fixtures/issues fail with Error: Cannot find module '@nuxtjs/i18n' ๐Ÿค”

BobbieGoede avatar Jul 05 '24 11:07 BobbieGoede

@kazupon I have updated/rebased this branch, it looks like it's mostly working except for the nested fixtures.. All fixtures inside specs/fixtures/issues fail with Error: Cannot find module '@nuxtjs/i18n' ๐Ÿค”

Fixing this required adding the following to pnpm-workspace.yaml:

- 'specs/fixtures/issues/*'

Not sure why or how it previously worked without issue ๐Ÿค” but it looks like all tests succeed now ๐Ÿ’ช

BobbieGoede avatar Jul 05 '24 11:07 BobbieGoede

@BobbieGoede Thanks! Oh, I missed the srcDir change ... ๐Ÿคฆโ€โ™‚๏ธ

The build of the nuxt docs is failing. It seems that nuxt modules that depend on them have not yet been released in a version compatible with nuxt 4.

kazupon avatar Jul 05 '24 15:07 kazupon

Closing since these changes are already included in v9

BobbieGoede avatar Mar 22 '25 00:03 BobbieGoede