Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/main' into fix/pages-hmr
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Nov 15, 2022
2 parents 9b6c662 + 1f645e2 commit 823e4f8
Show file tree
Hide file tree
Showing 18 changed files with 294 additions and 271 deletions.
2 changes: 1 addition & 1 deletion docs/content/1.getting-started/1.introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Discover more in the [Key concepts section](/guide/concepts/auto-imports).

### Rendering modes

Nuxt offers different rendering modes to accomodate various use-cases:
Nuxt offers different rendering modes to accommodate various use-cases:

::list{type=success}
- Universal rendering (Server-side rendering and hydration)
Expand Down
6 changes: 5 additions & 1 deletion docs/content/1.getting-started/2.installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,15 @@ npm install
```

```bash [pnpm]
pnpm install --shamefully-hoist
pnpm install
```

::

::alert
**Note:** If using **pnpm**, make sure to have `.npmrc` with `shamefully-hoist=true` inside it before `pnpm install`.
::

## Development Server

Now you'll be able to start your Nuxt app in development mode:
Expand Down
2 changes: 1 addition & 1 deletion docs/content/1.getting-started/5.seo-meta.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ And then in your layout file, you might use the route's metadata you have previo
const route = useRoute()
useHead({
meta: [{ name: 'og:title', content: `App Name - ${route.meta.title}` }]
meta: [{ property: 'og:title', content: `App Name - ${route.meta.title}` }]
})
</script>
```
Expand Down
3 changes: 2 additions & 1 deletion docs/content/2.guide/2.directory-structure/1.server.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ export default defineNuxtConfig({
host: "127.0.0.1", // Redis host
username: "", // needs Redis >= 6
password: "",
db: 0 // Defaults to 0
db: 0, // Defaults to 0
tls: {} // tls/ssl
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/content/3.api/1.composables/use-fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ All fetch options can be given a `computed` or `ref` value. These will be watche
::
* **Options (from `useAsyncData`)**:
* `key`: a unique key to ensure that data fetching can be properly de-duplicated across requests, if not provided, it will be generated based on the static code location where `useAyncData` is used.
* `key`: a unique key to ensure that data fetching can be properly de-duplicated across requests, if not provided, it will be generated based on the static code location where `useAsyncData` is used.
* `server`: Whether to fetch the data on the server (defaults to `true`).
* `default`: A factory function to set the default value of the data, before the async function resolves - particularly useful with the `lazy: true` option.
* `pick`: Only pick specified keys in this array from the `handler` function result.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/3.api/1.composables/use-nuxt-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Hooks available in `nuxtApp` allows you to customize the runtime aspects of your

`hook` function is useful for adding custom logic by hooking into the rendering lifecycle at a specific point. `hook` function is mostly used when creating Nuxt plugins.

See [Runtime Hooks](/api/advanced/hooks#app-hooks-runtime) for avialble runtime hooks called by Nuxt.
See [Runtime Hooks](/api/advanced/hooks#app-hooks-runtime) for available runtime hooks called by Nuxt.

```js [plugins/test.ts]
export default defineNuxtPlugin((nuxtApp) => {
Expand Down
2 changes: 1 addition & 1 deletion docs/content/3.api/1.composables/use-router.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ router.replace({ hash: "#bio" });

## Navigation Guards

`useRouter` composable provides `afterEach`, `beforeEach` and `beforeResolve` helper methods that acts as nagivation guards.
`useRouter` composable provides `afterEach`, `beforeEach` and `beforeResolve` helper methods that acts as navigation guards.

However, Nuxt has a concept of **route middleware** that simplifies the implementation of navigation guards and provides a better developer experience.

Expand Down
2 changes: 1 addition & 1 deletion docs/content/3.api/1.composables/use-runtime-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Variables that need to be accessible on the server are added directly inside `ru
::ReadMore{link="/guide/going-further/runtime-config"}
::

## Acess Runtime Config
## Access Runtime Config

To access runtime config, we can use `useRuntimeConfig()` composable:

Expand Down
2 changes: 1 addition & 1 deletion docs/content/3.api/5.commands/add.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ npx nuxi add middleware auth

## `nuxi add api`

* Modifier flags: `--method=connect|delete|get|head|options|patch|post|put|trace` or `--get`, `--post`, etc.
* Modifier flags: `--method` (can accept `connect`, `delete`, `get`, `head`, `options`, `patch`, `post`, `put` or `trace`) or alternatively you can directly use `--get`, `--post`, etc.

Example:

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"nuxt3": "workspace:nuxt@*",
"unbuild": "^0.9.4",
"vite": "^3.2.3",
"vue": "3.2.44"
"vue": "3.2.45"
},
"devDependencies": {
"@actions/core": "^1.10.0",
Expand All @@ -53,7 +53,7 @@
"@types/semver": "^7",
"@unocss/reset": "^0.46.4",
"case-police": "^0.5.10",
"changelogen": "^0.3.5",
"changelogen": "^0.4.0",
"crawler": "^1.3.0",
"eslint": "^8.27.0",
"eslint-plugin-jsdoc": "^39.6.2",
Expand Down
10 changes: 9 additions & 1 deletion packages/nuxi/src/commands/init.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { writeFile } from 'node:fs/promises'
import { downloadTemplate, startShell } from 'giget'
import { relative } from 'pathe'
import consola from 'consola'
Expand Down Expand Up @@ -27,9 +28,16 @@ export default defineNuxtCommand({

// Show next steps
const relativeDist = rpath(t.dir)

// Write .nuxtrc with `shamefully-hoist=true` for pnpm
const usingPnpm = (process.env.npm_config_user_agent || '').includes('pnpm')
if (usingPnpm) {
await writeFile(`${relativeDist}/.npmrc`, 'shamefully-hoist=true')
}

const nextSteps = [
!args.shell && relativeDist.length > 1 && `\`cd ${relativeDist}\``,
'Install dependencies with `npm install` or `yarn install` or `pnpm install --shamefully-hoist`',
'Install dependencies with `npm install` or `yarn install` or `pnpm install`',
'Start development server with `npm run dev` or `yarn dev` or `pnpm run dev`'
].filter(Boolean)

Expand Down
6 changes: 3 additions & 3 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"@nuxt/telemetry": "^2.1.6",
"@nuxt/ui-templates": "^0.4.0",
"@nuxt/vite-builder": "3.0.0-rc.13",
"@vue/reactivity": "^3.2.44",
"@vue/shared": "^3.2.44",
"@vue/reactivity": "^3.2.45",
"@vue/shared": "^3.2.45",
"@vueuse/head": "~1.0.0-rc.14",
"chokidar": "^3.5.3",
"cookie-es": "^0.5.0",
Expand Down Expand Up @@ -74,7 +74,7 @@
"unimport": "^0.7.0",
"unplugin": "^0.10.2",
"untyped": "^0.5.0",
"vue": "^3.2.44",
"vue": "^3.2.45",
"vue-bundle-renderer": "^0.5.0",
"vue-devtools-stub": "^0.1.0",
"vue-router": "^4.1.6"
Expand Down
5 changes: 3 additions & 2 deletions packages/nuxt/src/app/components/client-only.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { ref, onMounted, defineComponent, createElementBlock, h, createElementVN

export default defineComponent({
name: 'ClientOnly',
inheritAttrs: false,
// eslint-disable-next-line vue/require-prop-types
props: ['fallback', 'placeholder', 'placeholderTag', 'fallbackTag'],
setup (_, { slots }) {
setup (_, { slots, attrs }) {
const mounted = ref(false)
onMounted(() => { mounted.value = true })
return (props) => {
Expand All @@ -13,7 +14,7 @@ export default defineComponent({
if (slot) { return slot() }
const fallbackStr = props.fallback || props.placeholder || ''
const fallbackTag = props.fallbackTag || props.placeholderTag || 'span'
return createElementBlock(fallbackTag, null, fallbackStr)
return createElementBlock(fallbackTag, attrs, fallbackStr)
}
}
})
Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/src/pages/runtime/composables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ declare module 'vue-router' {
const warnRuntimeUsage = (method: string) =>
console.warn(
`${method}() is a compiler-hint helper that is only usable inside ` +
'the script block of a single file component. Its arguments should be ' +
'compiled away and passing it at runtime has no effect.'
'the script block of a single file component which is also a page. Its arguments should be ' +
'compiled away and passing it at runtime has no effect.'
)

// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down
4 changes: 2 additions & 2 deletions packages/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
"get-port-please": "^2.6.1",
"jiti": "^1.16.0",
"ohmyfetch": "^0.4.21",
"pathe": "^0.3.8"
"pathe": "^0.3.9"
},
"devDependencies": {
"playwright": "^1.27.1",
"unbuild": "latest",
"vitest": "^0.25.1"
},
"peerDependencies": {
"vue": "^3.2.44"
"vue": "^3.2.45"
},
"engines": {
"node": "^14.16.0 || ^16.10.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@nuxt/schema": "3.0.0-rc.13",
"@types/cssnano": "^5",
"unbuild": "latest",
"vue": "3.2.44"
"vue": "3.2.45"
},
"dependencies": {
"@nuxt/kit": "3.0.0-rc.13",
Expand All @@ -41,7 +41,7 @@
"pathe": "^0.3.9",
"perfect-debounce": "^0.1.3",
"pkg-types": "^0.3.6",
"postcss": "^8.4.18",
"postcss": "^8.4.19",
"postcss-import": "^15.0.0",
"postcss-url": "^10.1.3",
"rollup": "^2.79.1",
Expand All @@ -54,7 +54,7 @@
"vue-bundle-renderer": "^0.5.0"
},
"peerDependencies": {
"vue": "^3.2.44"
"vue": "^3.2.45"
},
"engines": {
"node": "^14.16.0 || ^16.10.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"ohash": "^0.1.5",
"pathe": "^0.3.9",
"pify": "^6.1.0",
"postcss": "^8.4.18",
"postcss": "^8.4.19",
"postcss-import": "^15.0.0",
"postcss-loader": "^7.0.1",
"postcss-url": "^10.1.3",
Expand All @@ -65,10 +65,10 @@
"@types/webpack-hot-middleware": "^2.25.6",
"@types/webpack-virtual-modules": "^0",
"unbuild": "latest",
"vue": "3.2.44"
"vue": "3.2.45"
},
"peerDependencies": {
"vue": "^3.2.44"
"vue": "^3.2.45"
},
"engines": {
"node": "^14.16.0 || ^16.10.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
Expand Down

0 comments on commit 823e4f8

Please sign in to comment.