1. 02 Oct, 2024 14 commits
    • vercel-release-bot's avatar
      v15.0.0-canary.177 · 54a37011
      vercel-release-bot authored
      54a37011
    • Steven's avatar
      fix(next/image): handle undefined `images.localPatterns` config in `images-manifest.json` (#70730) · f3651091
      Steven authored
      Since `images.localPatterns` config can be undefined, we need to support
      that when emitting `images-manifest.json`.
      
      - When `undefined`, all local images are allowed
      - When `[]`, no local images are allowed
      
      Note this is different than `remotePatterns` since it treats `undefined`
      and `[]` the same (the default being no remote images are allowed).
      f3651091
    • Joseph's avatar
      fix: Do not omit alt on getImgProps return type, ImgProps (#70608) · 1a81fe44
      Joseph authored
      ### What?
      
      Small type tweak, asked for in
      https://github.com/vercel/next.js/discussions/70443
      
      ### Why?
      
      The `alt` prop is required on the call to `getImgProps`, and the
      implementation, returns it back to the caller, however, the type
      signature of the return type for `getImgProps`, omits the `alt` prop,
      which means that users have to manually apply the `alt` prop.
      
      That is to say, that in this example, tweaked from the docs:
      
      ```jsx
      import { getImageProps } from 'next/image'
       
      export default function Page() {
        const common = { alt: 'Theme Example', width: 800, height: 400 }
        const {
          props: { srcSet: dark },
        } = getImageProps({ ...common, src: '/dark.png' })
        const {
          props: { srcSet: light, ...rest },
        } = getImageProps({ ...common, src: '/light.png' })
       
        return (
          <picture>
            <source media="(prefers-color-scheme: dark)" srcSet={dark} />
            <source media="(prefers-color-scheme: light)" srcSet={light} />
            {/* the alt prop is here, but as far as TypeScript is concerned, it is not */}
            <SomeCustomImageComponent {...rest} /> 
          </picture>
        )
      }
      ``` 
      
      So users have to do:
      
      ```jsx
            <SomeCustomImageComponent {...rest} alt={common.alt} /> 
      ```
      
      See more at, https://github.com/vercel/next.js/discussions/70443
      
      ### How?
      
      Remove `alt` from the Omit union.
      
      ```tsx
      export type ImgProps = Omit<ImageProps, 'src'  | 'alt' | 'loader'> & { /* other stuff */ }
      ```
      
      Fixes https://github.com/vercel/next.js/discussions/70443
      1a81fe44
    • Sebastian Markbåge's avatar
      Rename StaticGenerationStore to WorkStore (#70721) · 7958c79b
      Sebastian Markbåge authored
      This has long been a misnomer since it's not just used for static
      generation but it's the outer context of all the "Work" we're currently
      doing.
      
      A follow up will merge the other contexts into a "WorkUnitStore".
      7958c79b
    • Jiachi Liu's avatar
      39e06c75
    • Josh Story's avatar
      Separate the rendering of viewport from metadata (#70685) · 3853a7ff
      Josh Story authored
      viewport will never be streaming because is necessarily blocks important
      shell time rendering with things like themeColor and viewport size. Most
      other metadata can be streamed in if we're not serving an agent which
      doesn't construct a DOM. This change doesn't actually make metadata
      streaming but it does further separate the two so we can more easily
      alter the rendering characteristics of metadata without affecting
      viewport.
      
      The approach is to ensure the metadata component creation is in the
      react-server layer in the server module graph so it can access
      `React.cache`. then we construct a pair of functions that can produce
      the resolved metadata and viewport values, throwing if there is an
      encountered error. We suppress these errors in our top level metadata
      component (MetadataRoot) and and simultaneously expose a ready function
      which calls these (`React.cache()`'d) functions in the Metadata outlet
      where any errors will throw.
      
      This cleans up the layering quite a bit and makes some runtime error
      checks unecessary such as ensuring you rendered the MetadataRoot before
      attempting to determine if the metadata was resolved.
      
      The key thing achieved here though is that Metadata and Viewport now
      resolve in parallel but separately. We avoid double walking the module
      graph by again making use of `React.cache()`. In the future we can
      render each of these components differently without affecting each
      other.
      
      This work is motivated more immediately by some error tracking work I
      will land after this that needs to determine whether viewport or
      metadata were dynamic independently.
      
      There is one semantic difference worth calling out. Previously if you
      called `notFound()` in `generateMetadata()` or `generateViewport()` both
      would render the appropriate not found metadata/viewport. In this latest
      update only the one that called notFound will update to reflect the
      notFound metadata/viewport. I think fundamentally the approach to
      handling notFound needs to change here. Really we should be abandoning
      the render and starting over. This will be doubly important once
      metadata is streaming. I'm ok with the edge case as is given customizing
      viewport is not very common and calling notFound from within
      generateViewport is expected to be an edge case of an edge case. The
      workaround for now is to call notFound simultaneously from both
      generateViewport and generateMetadata
      3853a7ff
    • vercel-release-bot's avatar
      v15.0.0-canary.176 · 60dfe735
      vercel-release-bot authored
      60dfe735
    • Sebastian "Sebbie" Silbermann's avatar
    • Janka Uryga's avatar
      test: fix next-form tests when running on react 18 (#70704) · b95f0129
      Janka Uryga authored
      Fixes some broken tests from #68333. They were skipped, but still crash
      in `start` mode, because they try to use `useActionState` and crash
      during prerendering (because 18 doesn't have that). We turn those pages
      into noops instead -- the tests that use them are skipped anyway.
      b95f0129
    • Sebastian "Sebbie" Silbermann's avatar
    • Sebastian "Sebbie" Silbermann's avatar
    • Tobias Koppers's avatar
      [Turbopack] HMR invalidation improvements (#70494) · 043dbc85
      Tobias Koppers authored
      ### What?
      
      * round chunk item sizes to cause less changes to chunking
      * pick individual values from compile time info to avoid invalidating on
      change
      * pick next config keys for more granular caching
      * split completions into a tree
      
      ---------
      Co-authored-by: 's avatarNiklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
      043dbc85
    • マルコメ's avatar
      chore(docs): refactor README.md (#70503) · 1d1b846a
      マルコメ authored
      # Summary
      Remove redundant html element and css.
      Add alt text to images.
      Both old and new README.md have the same appearance. 
      
      ## Description
      I changed some parts.
      
      ### 1. Insert `align="center"` into only top `<div>` tag
      The all of logo, title, and badges are center.
      Then it doesn't need to call at every element.
      
      ### 2. Move `<h1>` tag outside `<a>` tag
      The title doesn't have link even if inside `<a>` tag when it's wrapped
      heading element.
      So put it out for the readability.
      
      ### 3. Use image alt text instead of aria-label
      Alt text is displayed on the page if the images can't be loaded.
      That's why I prefer alt text to aria-label.
      In addition, the screen reader still reads the same words after
      updating.
      
      ### Improving Documentation
      
      - [x] Run `pnpm prettier-fix` to fix formatting issues before opening
      the PR.
      - [x] Read the Docs Contribution Guide to ensure your contribution
      follows the docs guidelines:
      https://nextjs.org/docs/community/contribution-guide
      
      x-ref: [\<img>: The Image Embed
      element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img)
      | mdn web docs
      
      ---------
      Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
      1d1b846a
    • Janka Uryga's avatar
      [form] pages dir support (#68333) · f08fcd4b
      Janka Uryga authored
      This PR adds support for using Form with pages dir. The functionality is
      a bit limited:
      - in pages dir, Form doesn't prefetch, because there's no notion of an
      instant loading state that we could prefetch
      - No support for server actions
      - pending indicators from `useFormStatus` do not work while navigating
      to the target page (planning to address this in
      https://github.com/vercel/next.js/pull/70681)
      
      
      But other than those things, Form should work. Both of these patterns
      are supported:
      - `<Form action="/foo/bar">`
      - `<Form action={clientAction}>` (if using a react version with
      `useActionState`)
      f08fcd4b
  2. 01 Oct, 2024 21 commits
  3. 30 Sep, 2024 5 commits