refactor: renderer config to provide async stack tagging api implementation #34948
      
        
          +38
        
        
          −5
        
        
          
        
      
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
This moves the implementation of async stack tagging API to renderer config:
console.createTask().RN$unstable_createTask().Note
We want to implement
console.createTask()in React Native as well, it will take us quite some time to support async stack traces in Hermes and then implement async stack tagging APIs properly.The temporary React Native API will have the same signature, but it doesn't follow the same behaviour or implementation as Chromium's
console.createTask().We are only going to use it at the moment for capturing updates. We won't use it for owner stacks for now, because this API won't implement proper stack tagging, and we don't support async stack traces in Hermes, so we won't be able to recreate full owner stack branches, unfortunately. We don't want to patch
console.createTaskwith local host implementation, becauseconsole.createTaskis called for every JSX invocation, and we won't get any value from it, but we will capture the stack trace for every call.This approach aligns with other Web APIs, like
scheduleMicrotask,scheduleTimeout, etc.