Skip to content

Conversation

@hoxyq
Copy link
Contributor

@hoxyq hoxyq commented Oct 30, 2025

Summary:

Changelog: [Internal]

This defines the main entities for the console.createTask():

  • ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks.
  • ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript.
  • ConsoleTask: RAII-like object. Initialized only during the callback run of task.run(...).

I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from performance.measure implementation, for example.

Not using the word async anywhere in the naming, because the current implementation doesn't support async stack traces.

Differential Revision: D85481864

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 30, 2025
@meta-codesync
Copy link

meta-codesync bot commented Oct 30, 2025

@hoxyq has exported this pull request. If you are a Meta employee, you can view the originating Diff in D85481864.

hoxyq added a commit to hoxyq/react-native that referenced this pull request Oct 30, 2025
Summary:
Pull Request resolved: facebook#54334

# Changelog: [Internal]

This defines the main entities for the console.createTask():
- ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks.
- ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript.
- ConsoleTask: RAII-like object. Initialized only during the callback run of `task.run(...)`.

I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from `performance.measure` implementation, for example.

Not using the word `async` anywhere in the naming, because the current implementation doesn't support async stack traces.

Differential Revision: D85481864
hoxyq added a commit to hoxyq/react-native that referenced this pull request Oct 30, 2025
Summary:
Pull Request resolved: facebook#54334

# Changelog: [Internal]

This defines the main entities for the console.createTask():
- ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks.
- ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript.
- ConsoleTask: RAII-like object. Initialized only during the callback run of `task.run(...)`.

I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from `performance.measure` implementation, for example.

Not using the word `async` anywhere in the naming, because the current implementation doesn't support async stack traces.

Differential Revision: D85481864
hoxyq added a commit to hoxyq/react-native that referenced this pull request Oct 30, 2025
Summary:
Pull Request resolved: facebook#54334

# Changelog: [Internal]

This defines the main entities for the console.createTask():
- ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks.
- ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript.
- ConsoleTask: RAII-like object. Initialized only during the callback run of `task.run(...)`.

I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from `performance.measure` implementation, for example.

Not using the word `async` anywhere in the naming, because the current implementation doesn't support async stack traces.

Differential Revision: D85481864
@hoxyq hoxyq force-pushed the export-D85481864 branch 2 times, most recently from 0286f08 to 2cb6b4e Compare October 31, 2025 09:04
hoxyq added a commit to hoxyq/react-native that referenced this pull request Oct 31, 2025
Summary:

# Changelog: [Internal]

This defines the main entities for the console.createTask():
- ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks.
- ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript.
- ConsoleTask: RAII-like object. Initialized only during the callback run of `task.run(...)`.

I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from `performance.measure` implementation, for example.

Not using the word `async` anywhere in the naming, because the current implementation doesn't support async stack traces.

Differential Revision: D85481864
hoxyq added a commit to hoxyq/react-native that referenced this pull request Oct 31, 2025
Summary:

# Changelog: [Internal]

This defines the main entities for the console.createTask():
- ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks.
- ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript.
- ConsoleTask: RAII-like object. Initialized only during the callback run of `task.run(...)`.

I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from `performance.measure` implementation, for example.

Not using the word `async` anywhere in the naming, because the current implementation doesn't support async stack traces.

Differential Revision: D85481864
hoxyq added a commit to hoxyq/react-native that referenced this pull request Oct 31, 2025
Summary:

# Changelog: [Internal]

This defines the main entities for the console.createTask():
- ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks.
- ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript.
- ConsoleTask: RAII-like object. Initialized only during the callback run of `task.run(...)`.

I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from `performance.measure` implementation, for example.

Not using the word `async` anywhere in the naming, because the current implementation doesn't support async stack traces.

Differential Revision: D85481864
hoxyq added a commit to hoxyq/react-native that referenced this pull request Oct 31, 2025
Summary:

# Changelog: [Internal]

This defines the main entities for the console.createTask():
- ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks.
- ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript.
- ConsoleTask: RAII-like object. Initialized only during the callback run of `task.run(...)`.

I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from `performance.measure` implementation, for example.

Not using the word `async` anywhere in the naming, because the current implementation doesn't support async stack traces.

Differential Revision: D85481864
hoxyq added a commit to hoxyq/react-native that referenced this pull request Oct 31, 2025
Summary:

# Changelog: [Internal]

This defines the main entities for the console.createTask():
- ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks.
- ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript.
- ConsoleTask: RAII-like object. Initialized only during the callback run of `task.run(...)`.

I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from `performance.measure` implementation, for example.

Not using the word `async` anywhere in the naming, because the current implementation doesn't support async stack traces.

Differential Revision: D85481864
hoxyq added a commit to hoxyq/react-native that referenced this pull request Oct 31, 2025
Summary:

# Changelog: [Internal]

This defines the main entities for the console.createTask():
- ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks.
- ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript.
- ConsoleTask: RAII-like object. Initialized only during the callback run of `task.run(...)`.

I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from `performance.measure` implementation, for example.

Not using the word `async` anywhere in the naming, because the current implementation doesn't support async stack traces.

Differential Revision: D85481864
hoxyq added a commit to hoxyq/react-native that referenced this pull request Oct 31, 2025
Summary:

# Changelog: [Internal]

This defines the main entities for the console.createTask():
- ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks.
- ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript.
- ConsoleTask: RAII-like object. Initialized only during the callback run of `task.run(...)`.

I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from `performance.measure` implementation, for example.

Not using the word `async` anywhere in the naming, because the current implementation doesn't support async stack traces.

Differential Revision: D85481864
hoxyq added 4 commits November 3, 2025 08:21
Summary:

# Changelog: [Internal]

This is not used, nor required. The controller is the canonical way of using targets.

Reviewed By: huntie

Differential Revision: D85440639
…k#54282)

Summary:

# Changelog: [Internal]

It is already in a tracing session state, we are going to use it in RuntimeTarget.

Reviewed By: huntie

Differential Revision: D85440638
Summary:

# Changelog: [Internal]

This will control scenarios when we enable `console.createTask` implementation, and when we just use the stub version.

Reviewed By: huntie

Differential Revision: D85440641
Summary:

# Changelog: [Internal]

This defines the main entities for the console.createTask():
- ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks.
- ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript.
- ConsoleTask: RAII-like object. Initialized only during the callback run of `task.run(...)`.

I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from `performance.measure` implementation, for example.

Not using the word `async` anywhere in the naming, because the current implementation doesn't support async stack traces.

Reviewed By: sbuggay

Differential Revision: D85481864
hoxyq added a commit to hoxyq/react-native that referenced this pull request Nov 3, 2025
Summary:

# Changelog: [Internal]

This defines the main entities for the console.createTask():
- ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks.
- ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript.
- ConsoleTask: RAII-like object. Initialized only during the callback run of `task.run(...)`.

I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from `performance.measure` implementation, for example.

Not using the word `async` anywhere in the naming, because the current implementation doesn't support async stack traces.

Reviewed By: sbuggay

Differential Revision: D85481864
hoxyq added a commit to hoxyq/react-native that referenced this pull request Nov 3, 2025
Summary:

# Changelog: [Internal]

This defines the main entities for the console.createTask():
- ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks.
- ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript.
- ConsoleTask: RAII-like object. Initialized only during the callback run of `task.run(...)`.

I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from `performance.measure` implementation, for example.

Not using the word `async` anywhere in the naming, because the current implementation doesn't support async stack traces.

Reviewed By: sbuggay

Differential Revision: D85481864
hoxyq added a commit to hoxyq/react-native that referenced this pull request Nov 3, 2025
Summary:

# Changelog: [Internal]

This defines the main entities for the console.createTask():
- ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks.
- ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript.
- ConsoleTask: RAII-like object. Initialized only during the callback run of `task.run(...)`.

I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from `performance.measure` implementation, for example.

Not using the word `async` anywhere in the naming, because the current implementation doesn't support async stack traces.

Reviewed By: sbuggay

Differential Revision: D85481864
hoxyq added a commit to hoxyq/react-native that referenced this pull request Nov 3, 2025
Summary:

# Changelog: [Internal]

This defines the main entities for the console.createTask():
- ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks.
- ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript.
- ConsoleTask: RAII-like object. Initialized only during the callback run of `task.run(...)`.

I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from `performance.measure` implementation, for example.

Not using the word `async` anywhere in the naming, because the current implementation doesn't support async stack traces.

Reviewed By: sbuggay

Differential Revision: D85481864
hoxyq added a commit to hoxyq/react-native that referenced this pull request Nov 3, 2025
Summary:

# Changelog: [Internal]

This defines the main entities for the console.createTask():
- ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks.
- ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript.
- ConsoleTask: RAII-like object. Initialized only during the callback run of `task.run(...)`.

I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from `performance.measure` implementation, for example.

Not using the word `async` anywhere in the naming, because the current implementation doesn't support async stack traces.

Reviewed By: sbuggay

Differential Revision: D85481864
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants