1. 28 Dec, 2024 2 commits
  2. 27 Dec, 2024 2 commits
  3. 26 Dec, 2024 2 commits
  4. 25 Dec, 2024 2 commits
  5. 24 Dec, 2024 1 commit
  6. 23 Dec, 2024 6 commits
  7. 22 Dec, 2024 2 commits
  8. 20 Dec, 2024 21 commits
    • vercel-release-bot's avatar
      v15.1.1-canary.16 · 790efc59
      vercel-release-bot authored
      790efc59
    • Jiachi Liu's avatar
      1d285aef
    • Jiwon Choi's avatar
      Use Geist font in Dev Overlay (#74160) · eff54a38
      Jiwon Choi authored
      This PR added Geist font to be used in Dev Overlay.
      
      ![CleanShot 2024-12-21 at 00 19
      03](https://github.com/user-attachments/assets/0f126e2b-922a-4489-b356-cf0e09d361bb)
      
      Closes NDX-572
      eff54a38
    • vercel-release-bot's avatar
      v15.1.1-canary.15 · 7a49d14d
      vercel-release-bot authored
      7a49d14d
    • Hendrik Liebau's avatar
      Fix accessing headers in progressively enhanced form actions (#74196) · 887d7461
      Hendrik Liebau authored
      When scoping the `requestStore` to dynamic renders in #72312, we missed
      the case when a server action is invoked before hydration is complete.
      
      This leads to an error when a server action tries to read headers,
      cookies, or anything else that requires the presence of the
      `requestStore`.
      
      This fixes that for both the Node.js and Edge runtimes. It also appears
      that progressively enhanced form actions did not work at all before in
      the Edge runtime due to a missing `await` of `decodeFormState`.
      
      fixes #73992
      closes NAR-55
      887d7461
    • Wyatt Johnson's avatar
      refactor: remove internal queries, move to request metadata (#74100) · 2e46a18c
      Wyatt Johnson authored
      In order to simplify internal state management, this migrates internal
      use of query parameters over to storing details on the request metadata.
      Future PR's might be able to pull items off the metadata entirely and
      use prop drilling and the new `PageRenderContext`, `PageSharedContext`,
      and app equivalents.
      2e46a18c
    • Jiwon Choi's avatar
      Use ErrorOverlayLayout in Errors component (#74107) · 29aa6d12
      Jiwon Choi authored
      This PR modified the `Errors` (Runtime Error component) to use the shared `ErrorOverlayLayout`.
      
      ![CleanShot 2024-12-20 at 12 24 43@2x](https://github.com/user-attachments/assets/a6d5d224-318c-4d6f-ac46-21636961816a)
      29aa6d12
    • Jiachi Liu's avatar
    • Tobias Koppers's avatar
      [Turbopack] fix import.meta.url in monorepo (#72612) · 64efdadd
      Tobias Koppers authored
      ### What?
      
      fixes the computation of `import.meta.url` inside of monorepos (when the root_path != project_path)
      
      ### How?
      
      We add a new argument to the ChunkingContext that represents the relative path from the output folder to the root of the monorepo. Since they are on different filesystems, we can't compute them from the values alone.
      64efdadd
    • Jiwon Choi's avatar
      Port ToolButtonsGroup (#74099) · e79be056
      Jiwon Choi authored
      Ported the ToolButtonsGroup:
      
      ![CleanShot 2024-12-19 at 06 41 51](https://github.com/user-attachments/assets/11ac5d7e-057a-4bdc-bf0e-313410046612)
      e79be056
    • Jiwon Choi's avatar
      Port LeftIcon RightIcon from ErrorPagination (#74098) · f5912f7d
      Jiwon Choi authored
      Ported LeftIcon and RightIcon used in the pagination.
      f5912f7d
    • Jiwon Choi's avatar
      Port ErrorPagination (#74097) · b40e1a2d
      Jiwon Choi authored
      Ported `ErrorPagination` and replaced in the `Errors` component.
      b40e1a2d
    • Hendrik Liebau's avatar
      Allow usage of `this` and `arguments` in nested function expression (#74179) · 6fa146a4
      Hendrik Liebau authored
      In #73059 we added build-time checks for the forbidden usage of `this`
      and `arguments` in server functions. A nested function expression is
      however allowed to use these expressions.
      
      fixes #74181
      
      To add a bit more context: `this` is forbidden in server actions because
      the Next.js compiler hoists inline server actions out of their original
      location into the module scope, so that they can be imported and invoked
      by the action handler. Due to this hoisting, the `this` context gets
      lost and is not available to the server action.
      
      To prevent surprising runtime errors for such cases, we emit a build
      error to provide feedback to developers as early as possible.
      
      However, nested function declarations or function expressions create a
      new `this` context, and in those it's allowed to access `this` and
      `arguments`.
      
      For consistency, and to prevent surprises when refactoring server
      actions, we apply the same rules for module-level server actions.
      6fa146a4
    • Benjamin Woodruff's avatar
      chore(turbopack): Delete to-resolved-in-loop lint (too low signal) (#74113) · c0040412
      Benjamin Woodruff authored
      Had a discussion with @sokra about this during office hours. We were in agreement to delete this, not because it's usually wrong, but just because it's not high-signal enough:
      
      - Many instances of `to_resolved().await` are on simple constructor calls, so it doesn't really matter if they're sequential. We could add some heuristics for this, but they'd be imperfect.
      - `to_resolved().await` isn't actually what drives the work forward, it's the function call that schedules the work, so in some cases this isn't accurate (and you can't know without type information).
      - This would make more sense if we were typically starved for work, but usually we have more tokio tasks than we can process anyways, so increasing parallelism is unlikely to help in most cases.
      - Some code isn't performance sensitive (e.g. internal CLI utilities, tests), so this is just noise in those places.
      c0040412
    • Benjamin Woodruff's avatar
      refactor(turbopack): Rewrite CollectiblesSource callsites to use OperationVc (part 1/3) (#74051) · ad2282df
      Benjamin Woodruff authored
      `OperationVc`s should be used with `CollectiblesSource` instead of `Vc`s because collectibles represent a side-effect or implicit extra return value of a function's execution.
      
      This PR doesn't convert all callsites, just a handful.
      ad2282df
    • JJ Kasper's avatar
      Use provided waitUntil for pending revalidates (#74164) · 4e809908
      JJ Kasper authored
      Currently we are using `pendingWaitUntil` on `renderOpts` to handle
      pending revalidations (fetch updates and revalidate tag calls). This
      uses our old strategy of `waitUntil` inside of `sendResponse` which just
      keeps the stream open until the promise resolves. This isn't ideal if we
      have a proper waitUntil strategy provided so this updates to ensure we
      use that instead if available.
      
      Also adds some debug logs so we can track when this pending revalidates
      promise is resolved.
      4e809908
    • Benjamin Woodruff's avatar
      chore(turbopack): Remove or improve a few uses of `.to_resolved().await` inside a loop (#74112) · bc69d977
      Benjamin Woodruff authored
      - We should generally prefer `try_join` over `to_resolved().await` in a loop as it can provide more parallelism.
      - Some of these should just resolve the `Vc` outside the loop.
      bc69d977
    • Benjamin Woodruff's avatar
      refactor(turbo-tasks): Make State require OperationValue (#73876) · afddbe7a
      Benjamin Woodruff authored
      I started writing this PR by requiring `OperationValue` in `State`:
      
      ```diff
        impl<T> State<T> {
      -     pub fn new(value: T) -> Self {
      +     pub fn new(value: T) -> Self
      +    where
      +        T: OperationValue,
      +    {
      ```
      
      And then went through changing every compilation error that occurred as a result.
      
      ## Hacks
      
      **There are some hacks in a number of places here where we incorrectly convert `ResolvedVc` to `OperationValue`.**
      
      Unfortunately these have to exist because it's impractical to convert everything to `OperationValue`. `OperationValues` are harder to construct as they must be created directly from the return value of an unresolved function call.
      
      ## Why does `State<T>` need `T: OperationValue`?
      
      `OperationVc` types require that `.connect()` is called before their value can be read.
      
      As an internally-mutable type, `State` allows `Vc`s to be passed in ways that we cannot track. `.connect()` re-connects the `Vc` to the dependency graph so that strong resolution is possible.
      
      Without this, you might end up with stale results when reading a `Vc` inside of `State`, which can be very hard to debug.
      
      Fundamentally, I think `State` is unsound, but this is a band-aid on it until we can migrate to a better solution (likely effect-style `Collectibles` for `VersionedContentMap`).
      afddbe7a
    • Benjamin Woodruff's avatar
      refactor(turbo-tasks): Remove public OperationVc constructor, introduce a macro… · d240d450
      Benjamin Woodruff authored
      refactor(turbo-tasks): Remove public OperationVc constructor, introduce a macro annotation for creating OperationVc types (#72871)
      
      Introduces a new `operation` argument to the `#[turbo_tasks::function]` macro for creating functions that return `OperationVc`:
      
      ```
      // this function's external signature returns an `OperationVc`
      #[turbo_tasks::function(operation)]
      async fn multiply(value: OperationVc<i32>, coefficient: i32) -> Result<Vc<i32>> {
          Ok(Vc::cell(*value.connect().await? * coefficient))
      }
      ```
      
      This is important to solve a few major footguns with manually-constructed `OperationVc`s:
      
      - It can be hard to know if a `Vc` is an operation or not, and the only warning you'd get if you got it wrong was a runtime error.
      - Local-task-based resolution (#69126) will implicitly create local `Vc`s if an argument isn't resolved.
      - ~We want to enforce that all arguments to `OperationVc`-returning functions are also `OperationVc`s or non-`Vc` values. Otherwise you could end up with a stale/wrong `OperationVc`.~ Scrapped, this was too hard/impractical, see below.
      
      This removes the public constructor.
      
      Methods are not currently supported because:
      1. Operations are uncommon, and it's not worth the effort, IMO.
      2. There's no way to make it work for dynamic-dispatched method calls, as we cannot resolve the type of `self`. It could be made to work for inherent impls and non-object trait types.
      
      ---
      
      This is basically implementing @sokra's TODO comment in the old `OperationVc::new` constructor:
      
      ```
              // TODO to avoid this runtime check, we should mark functions with `(operation)` and return
              // a OperationVc directly
      ```
      
      But with assertions for the function arguments, based on some discussion in DMs:
      
      <img src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/HAZVitxRNnZz8QMiPn4a/13952614-f421-4c8a-99b8-3ce5f19715ae.png" width="600"/>
      
      We allow *either* `ResolvedVc` or `OperationVc` as arguments because:
      
      - Only accepting `OperationVc` arguments was impossible to refactor to, as this made it "viral" and there are too many places where we need to use operations that have too many dependencies.
      - While it makes sense for `State` to require `OperationVc` as arguments to any operation (keeps the whole dependency/call tree alive), for collectibles, sometimes you want the arguments to be `ResolvedVc`. It's just a matter of if you want to include collectibles generated when creating the arguments or not.
      d240d450
    • Benjamin Woodruff's avatar
      chore(turbopack): Ignore no-vc-struct lint in trybuild proc macro tests (#74110) · 5e0079e3
      Benjamin Woodruff authored
      These tests exist to see that the compiler generates errors when doing similar things to what the lint is designed to catch.
      
      I'd rather exempt these in the lint than in the trybuild tests, as once we get rid of support for the `local` opt-out in the `turbo_tasks::value` macro, we shouldn't need the lint anymore (it won't be possible to compile code using an unresolved `Vc` in a `VcValueType`), but we still will need these trybuild tests.
      5e0079e3
    • Zack Tanner's avatar
      used shared worker for lint & typecheck steps (#74154) · e411fd13
      Zack Tanner authored
      Similar to #73138, this removes the direct usage of `jest-worker` for
      the linting/typechecking step in favor of the shared worker that has
      built-in handling for propagating errors to the parent process. This is
      to ensure that if the worker performing the typechecking/linting
      receives a SIGKILL signal (which could happen with an OOM error), that
      the parent process exits appropriately.
      e411fd13
  9. 19 Dec, 2024 2 commits