1. 12 Sep, 2024 4 commits
  2. 11 Sep, 2024 2 commits
  3. 10 Sep, 2024 1 commit
  4. 09 Sep, 2024 7 commits
  5. 06 Sep, 2024 5 commits
  6. 04 Sep, 2024 2 commits
  7. 03 Sep, 2024 19 commits
    • hrmny's avatar
      feat(turbopack): add support for esm externals in app dir (#64918) · d09b769e
      hrmny authored
      Writes the async flag to the client reference manifest to support ESM
      externals in app dir.
      
      The `app-ssr` context can't have esm externals as that might cause a
      module to be async in ssr but not on the client.
      
      Closes PACK-2967
      Fixes #64525
      d09b769e
    • Janka Uryga's avatar
      dafdc81b
    • Will Binns-Smith's avatar
      Turbopack: Allow client components from foreign code in app routes (#64751) · 2c80812e
      Will Binns-Smith authored
      This extends #64520 to cover cases where client components originate
      from node_modules (foreign code).
      
      Test Plan: Extended the integration test to cover this
      
      Closes #64412
      Fixes PACK-3014
      
      ---------
      Co-authored-by: 's avatarOJ Kwon <1210596+kwonoj@users.noreply.github.com>
      2c80812e
    • Shu Ding's avatar
      Improve SWC transform ID generation (#69183) · 64731138
      Shu Ding authored
      This adds an extra `hash_salt` option to the Server Actions transform's
      `generate_action_id` method which defaults to empty for now (so no
      actual behavior changes). When set, the salt will be used to prefix the
      payload.
      64731138
    • Jiachi Liu's avatar
      9c4efb98
    • Jiachi Liu's avatar
      5eff016f
    • Tobias Koppers's avatar
      optimize server actions (#66523) · c8bde3ed
      Tobias Koppers authored
      ### What?
      
      optimize allocations in server actions transform
      
      In one edge case it reduces allocations from 30GB to 4.5MB and time from
      760ms to 11ms.
      
      ### Why?
      
      make it faster
      c8bde3ed
    • JJ Kasper's avatar
      Ensure we match comment minify behavior between terser and swc (#68372) · 562df1f0
      JJ Kasper authored
      Currently we are only strip all comments properly when `swcMinify:
      false` is set although the default is to use `swcMinify` which can cause
      confusion with these two modes not matching comments handling.
      
      This updates the default to match comment stripping between the two and
      also adds an experimental config to allow toggling this regardless of
      which minifier is being used.
      
      x-ref: [slack
      thread](https://vercel.slack.com/archives/C0676QZBWKS/p1722444791037279)
      x-ref: NEXT-3642
      562df1f0
    • Janka Uryga's avatar
    • Jiachi Liu's avatar
      Drop edge prerender manifest (#67787) · 3abfd56a
      Jiachi Liu authored
      Follow up for #67779 , we don't have to generate the edge preview
      manifest since it's mainly for rendering the preview props and now
      preview props can be accessed through process env by a util
      `getEdgePreviewProps()`
      3abfd56a
    • Janka Uryga's avatar
      abbc66c6
    • Janka Uryga's avatar
      test: fix static GETs · d57b805e
      Janka Uryga authored
      d57b805e
    • Jiachi Liu's avatar
      Fix edge preview props are not matched with cookie (#67779) · 0ab52398
      Jiachi Liu authored
      Chnage the way of preview props injection to edge runtime, directly read
      from env vars of preview props instead of writing to and reading from
      prerender manifest.js
      
      Previously we're trying to make these preview props values become
      deterministic that we can replace in edge deployment pipeline in #64521
      
      But the way of serializing process env vars in edge runtime is not
      correct. They'll remain as string "process.env.xxx" in the manifest and
      also after consumed. This PR fixes that behavior, instead of writing it
      into manifest, alwyas consuming from process.env.var directly.
      
      I created a shared util to access the preview props of edge runtime
      across all the templates.
      
      On draft provider side, we still need to handle dev mode case when
      preview id is `development-id`, but we already have the cookie, it
      cannot be aligned with the preview id. So we do a fallback check for dev
      mode if the cookie is present and preview id is `development-id` then we
      still treat it as draft mode is enabled.
      
      Fixes #52080
      Fixes #67075
      
      Closes NEXT-3541
      0ab52398
    • Janka Uryga's avatar
      f11346c8
    • JJ Kasper's avatar
      Add draft mode flag for multi-zone (#68997) · 1f299870
      JJ Kasper authored
      When an application is running in multi-zone API endpoints can have
      differing draft mode IDs on the same domain so we need to avoid clearing
      the original when we see a mismatch as that can break the current
      applications draft mode. This is behind a flag initially to validate but
      it should be safe to make the default in the future as an invalid draft
      mode ID just gets ignored.
      
      x-ref: [slack
      thread](https://vercel.slack.com/archives/C052BQ8F9EJ/p1723844164102539)
      1f299870
    • Tim's avatar
      fix: unstable_cache should not cache new result in draft mode (#67772) · 79177b7b
      Tim authored
      ### What?
      In draft mode, as of right now, `unstable_cache` does not read from the
      static store, but still write to it. This leads to the following
      scenario:
      
      1. Content Editor enters draft mode to test his content
      2. Content Editor skips cache and reads preview data
      3. Preview data is written to store
      4. Random user without draft mode receives preview data until cache is
      revalidated again
      
      ### Why?
      There's an early exit before reading from the cache - the new result is
      written to the cache nonetheless though.
      
      ### How?
      New result is only cached if draft mode is disabled.
      Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
      79177b7b
    • JJ Kasper's avatar
      Re-land build(edge): extract buildId into environment (#65426) · df864ec8
      JJ Kasper authored
      * Extract `buildId` and server action encryption key into environment
      variables for edge to make code more deterministic
      * Fixed the legacy bad env names from #64108
      * Always sort `routes` in prerender manifest for consistent output
      * Change `environments` to `env` in middleware manifest, confirmed with
      @javivelasco this is a fine change without need to bumping the version
      
      Dynamic variants like `buildId`, SA `encryptionKey` and preview props
      are different per build, which results to the non determinstic edge
      bundles. Once we extracted them into env vars then the bundles become
      deterministic which give us more space for optimization
      
      Closes NEXT-3117
      
      Reverts vercel/next.js#65425
      Co-authored-by: 's avatarJiachi Liu <inbox@huozhi.im>
      df864ec8
    • JJ Kasper's avatar
      Ensure edge prerender-manifest is minimal (#64946) · d44c1fb5
      JJ Kasper authored
      This ensures we don't include the entire prerender-manifest in edge
      runtime as it's un-necesary and can be very large. We only need the
      preview field in this manifest so this ensures we just include that.
      
      x-ref: [slack
      thread](https://vercel.slack.com/archives/C0289CGVAR2/p1713904966662599?thread_ts=1713798297.067699&cid=C0289CGVAR2)
      
      Closes NEXT-3212
      d44c1fb5
    • Wyatt Johnson's avatar
      Freeze loaded manifests (#64313) · 01c7c850
      Wyatt Johnson authored
      Manifests in the runtime should be treated as immutable objects to
      ensure that side effects aren't created that depend on the mutability of
      these shared objects. Instead, mutable references should be used in
      places where this is desirable.
      
      This also introduces the new `DeepReadonly` utility type, which when
      paired with existing manifest types, will modify every field to be read
      only, ensuring that the type system will help catch accidental
      modifications to these loaded manifest values as well.
      
      Future work could eliminate these types by modifying the manifest types
      themselves to be read only, only allowing code that generated them to be
      writable.
      
      Closes NEXT-3069
      01c7c850