Commit Graph

1409 Commits

Author SHA1 Message Date
Donny/강동윤 07a8b55956 perf(turbopack): Use ResolvedVc for turbopack-browser (#73198)
### What?

Use `ResolvedVc<T>` instead of `Vc<T>` for struct fields in `turbopack-browser`

### Why?

### How?
2024-11-28 03:23:09 +00:00
Donny/강동윤 72a4efe94b perf(turbopack): Use ResolvedVc for next-api, part 4 (#73237)
### What?

Use `ResolvedVc<T>` instead of `Vc<T>` for struct fields in `next-api`, but split into multiple PRs.

### Why?

To reduce scope of changes of each PRs so I can debug HMR failures.

### How?
2024-11-28 11:47:19 +09:00
Tobias Koppers 491e9c1a57 [Turbopack] Revert "refactor filesystem writes to an effect based system" (#73287)
Revert "Turbopack: apply effects in tests (#72952)"

This reverts commit b6b5ab88ac.

Revert "[Turbopack] fix effects tracing (#72928)"

This reverts commit 0714c45737.

Revert "[Turbopack] refactor filesystem writes to an effect based system (#72847)"

This reverts commit be9b2ddbf1.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the PR.
- Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to understand the PR)
- When linking to a Slack thread, you might want to share details of the conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
2024-11-27 23:53:54 +01:00
Donny/강동윤 b6be53236b perf(turbopack): Use ResolvedVc for next-api, part 3 (#73236)
### What?

Use `ResolvedVc<T>` instead of `Vc<T>` for struct fields in `next-api`, but split into multiple PRs.

### Why?

To reduce scope of changes of each PRs so I can debug HMR failures.

### How?
2024-11-28 07:03:38 +09:00
Donny/강동윤 ad8a47acca perf(turbopack): Use ResolvedVc for next-api, part 2 (#73235)
### What?

Use `ResolvedVc<T>` instead of `Vc<T>` for struct fields in `next-api`, but split into multiple PRs.

### Why?

To reduce scope of changes of each PRs so I can debug HMR failures.

### How?
2024-11-28 02:10:46 +09:00
Donny/강동윤 e81d4da9ec perf(turbopack): Use ResolvedVc for next-api, part 1 (#73234)
### What?

Use `ResolvedVc<T>` instead of `Vc<T>` for struct fields in `next-api`, but split into multiple PRs.

### Why?

To reduce scope of changes of each PRs so I can debug HMR failures.

### How?
2024-11-27 22:42:27 +09:00
Donny/강동윤 12368471c3 perf(turbopack): Use ResolvedVc for turbo-tasks-fetch (#73201)
### What?

Use `ResolvedVc<T>` instead of `Vc<T>` for struct fields in
`turbopack-tasks-fetch`.

### Why?

### How?
2024-11-27 10:51:17 +01:00
Hendrik Liebau 214e0d3252 Forbid super in static class methods with server function directives (#73061) 2024-11-26 19:19:16 +01:00
Hendrik Liebau 12c483aa4d Don't hoist a server function if a compile error was emitted (#73189)
This allows us to skip unnecessary work, and also avoids generating invalid code, e.g. not allowed `super` calls in hoisted methods.
2024-11-26 17:24:10 +01:00
Niklas Mischkulnig 6a2d350249 Turbopack: make client references actual references (#73174)
aka "one graph"

- Make client references actual references (non-chunkable, so chunking
ignores them right now. We can change that later and move more chunking
into Turbopack itself as opposed to the manual stuff in `AppEndpoint`)
- `find server actions` now just walks the rsc_entry and discovery
client references itself
- `collecting next/dynamic` still walks the RSC graph which is wrong (as
before). I left this to make this PR a noop that shouldn't change any
behavior. We'll fix this in the coming reimplementation (and add tests
for what is apparently currently not asserted 😐)

**View without whitespace changes**

Closes PACK-3532
2024-11-26 15:30:52 +01:00
Donny/강동윤 642bf10092 perf(turbopack): Use ResolvedVc for turbopack-nodejs (#73200)
### What?

Use `ResolvedVc<T>` instead of `Vc<T>` for struct fields in `turbopack-nodejs`.

### Why?

### How?
2024-11-26 17:50:59 +09:00
Donny/강동윤 784808a88c perf(turbopack): Use ResolvedVc for turbopack-core (#73065)
### What?

Use `ResolvedVc<T>` instead of `Vc<T>` for struct fields in `turbopack-core`

### Why?

### How?
2024-11-26 14:41:35 +09:00
Niklas Mischkulnig 2d4d837350 Turbopack: don't compute all paths for builds (#73036)
Depends on https://github.com/vercel/next.js/pull/73010

A very small speedup, mostly noticeable in cpu time, not really in wall
time
```
before:
    504.86s user 73.31s system 792% cpu 1:12.93 total
    522.09s user 76.70s system 778% cpu 1:16.94 total
    503.73s user 68.78s system 818% cpu 1:09.92 total
after: 
    471.20s user 61.73s system 757% cpu 1:10.33 total
    481.69s user 69.05s system 805% cpu 1:08.33 total
```
2024-11-25 19:04:44 +01:00
Hendrik Liebau 6602327c72 Handle server function directives in class methods (#73060)
With this PR, we are allowing _static_ class methods to be annotated with `"use cache"` or `"use server"`.

Class _instance_ methods on the other hand are not allowed as server functions.
2024-11-25 15:26:24 +01:00
Hendrik Liebau adfdd09d53 Omit unnecessary cache wrapper import (#73160)
When a `"use cache"` module has no exported or annotated cache function, we can omit the import statement for the cache wrapper function.
2024-11-25 15:00:38 +01:00
Niklas Mischkulnig 1899edd047 Turbopack: more tracing spans (#73010)
- adds per-module tracing for `find server actions` (it's implemented in
the same way for next/dynamic and client references). Now, `find server
actions` isn't just a single blob anymore.
- add a tracing span for `all_server_paths`
2024-11-25 13:20:17 +01:00
Hendrik Liebau c53ee73cf1 Forbid this and arguments in server functions (#73059)
Accessing `this` or `arguments` in server functions is not allowed. With
this PR, we are now emitting build errors in this case.

---------

Co-authored-by: Janka Uryga <lolzatu2@gmail.com>
2024-11-23 23:46:24 +01:00
Hendrik Liebau 2161d8c012 Method/function props of exported objects are not server functions (#73058)
This is a follow-up fix for #72969. Method or function properties of exported objects in `"use cache"` or `"use server"` files must not be compiled into server functions, unless they have an inline server directive.
2024-11-23 08:59:49 +01:00
Hendrik Liebau 04adb76405 Disallow multiple server directives at the same level (file or function) (#73018)
This PR has two main goals:

- **Consolidate the detection of server directives in modules and function bodies.** Previously, these were two separate implementations with significant overlap, but also some [questionable discrepancies](https://github.com/vercel/next.js/pull/72811#discussion_r1843660381).
- **Model the current directive (in a file or function) using an enum instead of two separate booleans.** This change prevents any confusion that both directives might be present simultaneously. Additionally, we're now emitting an error if multiple directives (`"use server"` and `"use cache"`) are defined in the same location (at the top of a file or function body).

A mixed usage of `"use server"` and `"use cache"` _across different locations_ is still allowed, e.g. `"use cache"` at the top of a file, and `"use server"` in a function.

> [!NOTE]  
> The diff may be tricky to review because chunks from two different functions are combined into a single function. Fortunately, we have comprehensive test coverage for the transforms, which instills high confidence that these changes are correct.
2024-11-22 21:35:44 +01:00
Jiachi Liu 37f26ac289 Add forbidden and unauthorized APIs (#72785) 2024-11-21 20:59:19 +01:00
Zack Tanner 26cdaa8325 create forked impl for Link component (#73019)
There's significant drift between how Link is implemented in pages vs app dir, and we're planning to make even more changes. (For example, we want to change the intersection observer prefetch behavior, but only in app router)

To simplify this drift in behavior, this will alias `next/link` to `client/app-dir/link.tsx` in app dir bundles. 

There is no change in behavior to the `link` component in this PR. The next PR in the stack will remove the current forked handling to remove things that are irrelevant to the router it's rendered in.
2024-11-21 09:24:42 -05:00
Donny/강동윤 c8f96d50ff perf(turbopack): Enable merging of export fragments (#72813)
### What?

Enable single-incoming-edge optimization for module fragments with `ModulePart::Export`. 

### Why?

It will reduce the number of modules greatly.



### How?

Closes PACK-3481
2024-11-21 23:06:41 +09:00
Tobias Koppers 7885f884a2 [Turbopack] Invalidation and Persisting fixes (#72950)
### What?

* make invalidation more granular
* fix untagged enum serialization
    * fixes ppr config option serialization
* fix typo
* improve tracing
* less aggressive persisting
* fix verify_serialization feature
2024-11-21 12:36:13 +01:00
Jude Gao 4d76f9831d experimental: css inlining (#72195) 2024-11-20 17:03:40 -05:00
Niklas Mischkulnig 2792c3a056 Turbopack: Change edge wrapper to proxy exports (#72502)
The edge runtime does `await
self._ENTRIES["middleware_..."].default.call(...)`, so instead export a
Proxy that hides that the module object itself is a promise.

Partial revert of https://github.com/vercel/next.js/pull/62141
2024-11-20 22:17:28 +01:00
Hendrik Liebau 8c6ac898c3 Allow method properties to be server functions (#72969)
With this PR, we are now allowing `"use server"` and `"use cache"` to be
used in method properties, e.g.:

```js
export const obj = {
  async foo() {
    'use cache'

    return Math.random()
  },
  async bar() {
    'use server'

    console.log(42)
  },
}
```

Or, more realistically, something like this:

```js
export const api = {
  product: {
    async fetch() {
      'use cache'

      return fetch('https://example.com').then((res) => res.json())
    },
  },
}
```

Supporting this pattern is mostly done for convenience; it allows users
to group server functions into a common object, using method properties.
Notably, we will not support the usage of `this` and `super`, for which
we will add build errors in a follow-up PR.
2024-11-20 09:58:08 +01:00
Hendrik Liebau 44cb7dddfe Consolidate FnExpr and FnDecl server function transforms (#72960)
By adding `visit_mut_function` we can deduplicate the code that's common between `visit_mut_fn_expr` and `visit_mut_fn_decl`. And more importantly, this prepares us for handling the transform of method props, which will also use `visit_mut_function`.

As a positive side effect this brings two small improvements with it:
- always highlight the whole function when `async` is missing, not only the identifier
- assign a function name to an anonymous arrow function expression in a variable declaration
2024-11-20 09:07:01 +01:00
Alexander Lyon c8ba12f2ed Turbopack: NFT followups (#72517)
Closes PACK-3421

Address PR feedback from https://github.com/vercel/next.js/pull/72305

When working on this, I uncovered another bug which will be handled in a
different PR.

Changes:
- Don't rely on `DiskFileSystem` but only via file paths and
`is_inside()`
- Put the `RebasedAsset` for externals on the `[project]/` fs (this way,
they aren't emitted either), i.e. don't perform any rebasing at all and
just reference the files where they are

---------

Co-authored-by: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
2024-11-19 19:48:06 +01:00
Alexander Lyon 60dd201043 Turbopack NFT: trace manifests and externals (#72316)
- Change the Next manifest output assets to also track references to output assets there. That way, `page.js.nft.json` lists the referenced output assets of `page.js` and e.g. `page_client-reference-manifest.js` and all the chunks references in the manifest as well.
- For `ResolveResultItem::External`, continue resolving with a fresh `ModuleAssetContext` that doesn't have any of the build-time settings (because the Node environment when running the server won't have these settings either).


Closes PACK-3380
2024-11-19 17:51:26 +01:00
Alexander Lyon 6f936688cb Turbopack: thread tracing through to resolve results (#72314)
The bread and butter of NFT. The next two PRs split the work into two halves, one half plumbs as far as ResolveResultItem, and the next one fills in the remaining (and fixes some bugs).


Closes PACK-3379
2024-11-19 15:14:10 +01:00
Tobias Koppers be9b2ddbf1 [Turbopack] refactor filesystem writes to an effect based system (#72847)
### Why?

Before we just wrote the files in `FileSystem::write()`, but that caused some issues when two `FileSystem::write()` tasks are active (or even temporarily active) at the same time. They invalidate each other and basically caused a loop of writes.

For a long time we wanted to have a better solution for that, since that problem causes compilation to hang with 100% cpu load, which is quite annoying.

Also the eventual consistency can cause some unexpected writes to be done when the content or filename are on a temporary value that has not stabilised yet.

The problem applies to every side effect in tasks.

### What?

To solve that this refactoring changes the way side effects in tasks are handled.

Side effects in tasks should not be directly executed anymore. Instead one should emit an "effect" (`effect(async { ... })` helper method) to declare a side effect that should be executed. Top level execution is usually wrapped in a strongly consistent read of the top level task. Here one need to apply the "effects" (`apply_effects(operation).await?` helper method). Since this happens after the strongly consistent read, only effects that have been stabilised are executed.

It's also possible to call `apply_effects` somewhere nested in the execution (after a strongly consistent read) if side effects are necessary for further execution. e. g. we do that to emit the files for the node.js pool before executing the pool.

Internally effects are collectibles that are propagated through the call graph. Each effect can only be executed once, so updates to the graph will only apply new effects while existing effects are skipped as they were already executed.

The actual change is pretty simple, but `FileSystem::write` no longer returns a `Vc<Completion>` but nothing instead. This makes the change needed a bit bigger.

Good news: To emit a whole (potential circular) graph we could use recursion now instead of needing to walk the graph while avoiding cycles. This might allow some performance improvements for incremental builds.
2024-11-18 09:05:27 +01:00
Hendrik Liebau d54122a712 Emit build error for unknown cache kinds (#72832)
When a `"use cache"` directive with a custom cache kind is used, e.g.
`"use cache: custom"`, a cache handler with the same name must be
specified in the Next.js config:

```js
/**
 * @type {import('next').NextConfig}
 */
const nextConfig = {
  experimental: {
    dynamicIO: true,
    cacheHandlers: {
      custom: require.resolve('path/to/custom/cache/handler'),
    },
  },
}

module.exports = nextConfig
```

If this is not the case, we emit a build error with an error message
that explains this requirement.

<img width="795" alt="Screenshot 2024-11-14 at 23 30 01"
src="https://github.com/user-attachments/assets/bd138c97-608f-42ce-abb2-edb3e44edc3f">

When we'll get a docs page for this experimental config, we will add the
usual "Read more: ..." hint as well.

---------

Co-authored-by: Benjamin Woodruff <benjamin.woodruff@vercel.com>
Co-authored-by: Janka Uryga <lolzatu2@gmail.com>
2024-11-17 17:03:16 +01:00
Donny/강동윤 bcabce70dc refactor(turbopack): Use ResolvedVc for turbopack-ecmascript (#72564)
### What?

Use `ResolvedVc` for struct fields in `turbopack-ecmascript` crate

### Why?

Follow-up of https://github.com/vercel/next.js/pull/72200,
https://github.com/vercel/next.js/pull/72382,
https://github.com/vercel/next.js/pull/72320

### How?

Closes PACK-3438

---------

Co-authored-by: Benjamin Woodruff <benjamin.woodruff@vercel.com>
2024-11-16 13:35:56 +09:00
Benjamin Woodruff 3fbe729297 refactor(turbo-rcstr): Move turbo_tasks::RcStr into it's own crate (#72858)
The `RcStr` type doesn't use anything in `turbo-tasks`, so there's no reason it can't be a separate crate that doesn't depend on `turbo-tasks`.

This will let it be used in wasm swc plugins, where turbo-tasks does not currently compile.

Imports were automatically rewritten with:

```
# Fix imports:
sg run --lang rust --pattern 'use $CRATE::{$$$PRE, RcStr};' --rewrite 'use $CRATE::{$$$PRE}; use turbo_rcstr::RcStr;' --update-all
sg run --lang rust --pattern 'use $CRATE::{RcStr, $$$POST};' --rewrite 'use $CRATE::{$$$POST}; use turbo_rcstr::RcStr;' --update-all
sg run --lang rust --pattern 'use $CRATE::{$$$PRE, RcStr, $$$POST};' --rewrite 'use $CRATE::{$$$PRE, $$$POST}; use turbo_rcstr::RcStr;' --update-all
sg run --lang rust --pattern 'use $CRATE::RcStr;' --rewrite 'use turbo_rcstr::RcStr;' --update-all
cargo fmt

# Fix strings in comments:
fastmod crate::RcStr turbo_rcstr::RcStr
fastmod turbo_tasks::RcStr turbo_rcstr::RcStr
```

I had to manually fix the `Cargo.toml` files based on the compilation errors.
2024-11-15 17:08:20 -05:00
Hendrik Liebau 0f9f442b7b Consolidate server actions transform errors into emit_error function (#72811)
This improves maintainability and readability by decluttering the server actions transforms implementation, dedupes a few error messages, and consistently uses periods and trailing newlines for all error messages.

The same approach is already used for the React Server Components transforms.
2024-11-15 13:55:19 +01:00
Tobias Koppers 086f715c27 [Turbopack] avoid writing manifests in data/rsc variant of page (#72767)
### What?

The `data` variant for pages and the `rsc` variant for app router (for change notification purposes) causes some conflicting writes in the next-rs test case. This causes some instability since we are invalidating in a loop.
2024-11-15 09:08:17 +01:00
Donny/강동윤 7b89b021cc refactor(turbopack): Use ResolvedVc for turbopack crate (#72791)
### What?

Follow-up for https://github.com/vercel/next.js/pull/72564

### Why?

We need to refactor this for future works.

### How?

---------

Co-authored-by: Benjamin Woodruff <benjamin.woodruff@vercel.com>
2024-11-14 22:58:55 +00:00
Benjamin Woodruff 57e732fc53 chore(turbopack): Centralize reqwest TLS feature configs in turbo-tasks-fetch (#72526)
Noticed this mess while working with @samcx on #72442 where we had to run:

```
cargo nextest r --features next-core/native-tls -p next-core
```

This PR makes `turbo-tasks-fetch` responsible for setting the `reqwest` TLS features, rather than trying to pass that feature flag down.

After this PR, running tests on `next-core` works with just:

```
cargo nextest r -p next-core
```

## Why?

- The feature flag logic was getting duplicated in multiple top-level targets.
- Packages that depended on `turbo-tasks-fetch` (directly *or transitively*) had to specify a default feature and make sure that default feature was disabled in the workspace's dependency list so that `cargo test -p package-name` would work
- ... or you had to specify a flag when compiling, like `--features next-core/native-tls`.

Technically this change gives us less flexibility. We can't produce multiple binaries for the same platform target with different TLS stacks. But I don't think we would've ever used that flexibility anyways.
2024-11-14 16:21:52 -05:00
Jiwon Choi 0cbc0793c4 silence sass legacy-js-api warning (#72632)
### Why?

This PR silences `legacy-js-api` warning enabled from PR
https://github.com/vercel/next.js/pull/70067 by updating the
`sass-loader` to v15. Will follow up with adding an option to enable the
sass-loader v16 by PR https://github.com/vercel/next.js/pull/72423.

x-ref: https://github.com/vercel/next.js/issues/71638
2024-11-14 14:57:40 +09:00
Hendrik Liebau 2c6b09d57d Emit build error when "use cache" is used without dynamicIO enabled (#72781)
Using a build error instead of a runtime error allows us to fail early,
and show a proper error source in the terminal and in the dev overlay.

<img width="777" alt="Screenshot 2024-11-13 at 22 19 45"
src="https://github.com/user-attachments/assets/d0ee3c69-71f5-4aa6-8c0a-879217f66930">
2024-11-13 21:43:58 +00:00
Hendrik Liebau c3467c7f5f Remove unused enabled config from server actions transforms (#72755)
The option was always set to `true` so we can safely remove it. The
experimental `serverActions` flag was removed a long time ago in #57145.
2024-11-13 11:55:34 +00:00
Jam Balaya 3c3710bef4 chore: update getting-started/react-essentials path (#72250)
## Description
At #51579, react-essentials.mdx was deleted.
Some URLs doesn't navigate right pages due to this change.
Then I update to correct path.

- Fixes https://github.com/vercel/next.js/issues/72566

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-11-12 16:07:47 -08:00
Tobias Koppers 1140e07fc9 [Turbopack] add BackendOptions and allow to disable dependencies, children and storage (#72426)
### What?

Add options for the new backend to disable certain features.

* Storage can be disabled to avoid capturing change log data.
* Dependency tracking can be disabled when no changes are expected and no persistence is used
* Children tracking can be disabled for testing purposes.


Closes PACK-3405
2024-11-12 19:57:27 +01:00
Hendrik Liebau 3898a7a99b Include bound args param in server reference information byte arg mask (#72588)
Considering the bound args param in the server reference information byte is required for a client-side optimization of omitting unused arguments to work properly when a server action or `"use cache"` function uses closed-over variables.

The server reference information byte is not used yet, so this PR should not change any observable behavior.
2024-11-12 18:35:16 +01:00
Hendrik Liebau 883c337177 Combine bound "use cache" closure args into a single parameter (#72587)
This is a pure refactoring without any behavioral changes. It will allow us to more easily incorporate the presence of the bound args param into the server reference information byte.
2024-11-12 18:02:45 +01:00
Donny/강동윤 f8a10c79bf refactor(turbopack): Remove swc_css (#72602)
### What?

Remove `swc_css` from turbopack. It would not break the existing codebase, so it's fine.
2024-11-12 17:36:48 +09:00
Niklas Mischkulnig 82ef14c826 Turbopack: Don't run PostCSS on internal assets (#72579)
Closes PACK-3318
Closes https://github.com/vercel/next.js/issues/71618

This is a good idea in general, and also works around a Tailwind bug
breaking `next/font`:
https://github.com/tailwindlabs/tailwindcss/issues/14951
2024-11-11 19:57:37 +01:00
Benjamin Woodruff 856e4bf5ce codemod(turbopack): Replace return Err(anyhow!()) with anyhow::bail!() (#72487)
Early returns should use `anyhow::bail!()`.

Ran ast-grep with

```bash
sg run --lang rust --pattern 'return Err(anyhow!($$$ARGS));' --rewrite 'anyhow::bail!($$$ARGS)' --update-all && sg run --lang rust --pattern 'return Err(anyhow::anyhow!($$$ARGS));' --rewrite 'anyhow::bail!($$$ARGS)' --update-all && cargo fmt
```

Manually cleaned up unused import warnings (second commit) because `cargo fix` hangs (idle, no CPU usage) about halfway through our build, and I'm not sure why. I tested the latest nightly, and it hangs too.
2024-11-08 16:17:05 -08:00
Janka Uryga e5ae38355e fix: decrypt bound args before generating a cache key (#72463) 2024-11-08 21:25:09 +01:00
Alexander Lyon 4fba975cda set up options / hooks to enable turbotrace (#72306)
Adds tracing settings to the various contexts that are used for nft

There are cases where we need to know whether tracing is useful, this PR sets up that state ahead of the next one(s) which actually take advantage of them.

Closes PACK-3377
2024-11-08 01:04:52 +01:00