Skip to content

Commit 9a11242

Browse files
amirhhashemikodiakhq[bot]LadyBluenotes
authored
Remove inconsistent terms for tracking scope (#1087)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Sarah <gerrardsarah@gmail.com>
1 parent 58ef728 commit 9a11242

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

src/routes/concepts/stores.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ const App = () => {
9191
```
9292

9393
When a store is created, it starts with the initial state but does _not_ immediately set up signals to track changes.
94-
These signals are created **lazily**, meaning they are only formed when accessed within a reactive context.
94+
These signals are created **lazily**, meaning they are only formed when accessed within a tracking scope.
9595

96-
Once data is used within a reactive context, such as within the return statement of a component function, computed property, or an effect, a signal is created and dependencies are established.
96+
Once data is used within a tracking scope, such as within the return statement of a component function, computed property, or an effect, a signal is created and dependencies are established.
9797

9898
For example, if you wanted to print out every new user, adding the console log below will not work because it is not within a tracked scope.
9999

@@ -433,7 +433,7 @@ Consequently, only `'koala'` - the new edition - will cause an update.
433433

434434
### Extracting raw data with `unwrap`
435435

436-
When there is a need for dealing with data outside of a reactive context, the `unwrap` utility offers a way to transform a store to a standard [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object).
436+
When there is a need for dealing with data outside of a tracking scope, the `unwrap` utility offers a way to transform a store to a standard [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object).
437437
This conversion serves several important purposes.
438438

439439
Firstly, it provides a snapshot of the current state without the processing overhead associated with reactivity.

src/routes/guides/complex-state-management.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Through `state.numberOfTasks`, the display will now show the store's value held
139139

140140
When you want to modify your store, you use the second element returned by the `createStore` function.
141141
This element allows you to make modifications to the store, letting you both add new properties and update existing ones.
142-
However, because properties within a store are created lazily, setting a property in the component function body without creating a reactive scope will **not** update the value.
142+
However, because properties within a store are created lazily, setting a property in the component function body without creating a tracking scope will **not** update the value.
143143
To create the signal so it reactively updates, you have to access the property within a tracking scope, such as using a [`createEffect`](/reference/basic-reactivity/create-effect):
144144

145145
```jsx

src/routes/reference/lifecycle/on-cleanup.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ title: onCleanup
33
order: 5
44
---
55

6-
`onCleanup` registers a cleanup method that executes on disposal and recalculation of the current reactive scope.
6+
`onCleanup` registers a cleanup method that executes on disposal and recalculation of the current tracking scope.
77
Can be used anywhere to clean up any side effects left behind by initialization.
88

99
When used in a Component, it runs when the component is unmounted.
10-
When used in reactive contexts, such [`createEffect`](/reference/basic-reactivity/create-effect), [`createMemo`](/reference/basic-reactivity/create-memo) or a [`createRoot`](/reference/reactive-utilities/create-root), it runs when the reactive scope is disposed or refreshed.
10+
When used in tracking scope, such [`createEffect`](/reference/basic-reactivity/create-effect), [`createMemo`](/reference/basic-reactivity/create-memo) or a [`createRoot`](/reference/reactive-utilities/create-root), it runs when the tracking scope is disposed or refreshed.
1111

1212
```ts
1313
import { onCleanup } from "solid-js"

src/routes/reference/reactive-utilities/create-root.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function createRoot<T>(fn: (dispose: () => void) => T): T
1010
```
1111

1212
Creates a new non-tracked owner scope that doesn't auto-dispose.
13-
This is useful for nested reactive scopes that you do not wish to release when the parent re-evaluates.
13+
This is useful for nested tracking scopes that you do not wish to release when the parent re-evaluates.
1414

1515
All Solid code should be wrapped in one of these top level as they ensure that all memory/computations are freed up.
1616
Normally you do not need to worry about this as createRoot is embedded into all render entry functions.

src/routes/reference/reactive-utilities/get-owner.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function getOwner(): Owner
1010

1111
```
1212

13-
Gets the reactive scope that owns the currently running code, e.g., for passing into a later call to `runWithOwner` outside of the current scope.
13+
Gets the tracking scope that owns the currently running code, e.g., for passing into a later call to `runWithOwner` outside of the current scope.
1414

1515
Internally, computations (effects, memos, etc.) create owners which are children of their owner, all the way up to the root owner created by `createRoot` or `render`.
1616
In particular, this ownership tree lets Solid automatically clean up a disposed computation by traversing its subtree and calling all `onCleanup` callbacks.
@@ -20,5 +20,5 @@ Calling `getOwner` returns the current owner node that is responsible for dispos
2020
Components are not computations, so do not create an owner node, but they are typically rendered from a `createEffect` which does, so the result is similar: when a component gets unmounted, all descendant `onCleanup` callbacks get called.
2121
Calling `getOwner` from a component scope returns the owner that is responsible for rendering and unmounting that component.
2222

23-
Note that the owning reactive scope isn't necessarily tracking.
24-
For example, untrack turns off tracking for the duration of a function (without creating a new reactive scope), as do components created via JSX (`<Component ...>`).
23+
Note that the owning tracking scope isn't necessarily tracking.
24+
For example, untrack turns off tracking for the duration of a function (without creating a new tracking scope), as do components created via JSX (`<Component ...>`).

src/routes/reference/reactive-utilities/untrack.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: untrack
33
---
44

5-
Ignores tracking any of the dependencies in the executing code block and returns the value. This helper is useful when a certain `prop` will never update and thus it is ok to use it outside of the reactive context.
5+
Ignores tracking any of the dependencies in the executing code block and returns the value. This helper is useful when a certain `prop` will never update and thus it is ok to use it outside of the tracking scope.
66

77
```tsx title="component.tsx"
88
import { untrack } from "solid-js"

0 commit comments

Comments
 (0)