- 
                Notifications
    You must be signed in to change notification settings 
- Fork 49.7k
[Flight] Add "use ..." boundary after the change instead of before it #33478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
        
      
    Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    
            
                  unstubbable
  
            
            approved these changes
            
                
                  Jun 7, 2025 
                
            
            
          
          
b444393    to
    dddd8b8      
    Compare
  
    This ensures it has no owner which makes it inherit the owner and stack of where it is parsed.
In this case of creating a stack in the client, we won't already have the parsed form.
We assume that the first component that has the new environment has a stack which is inside the owner. Since we override the stack of the root owner.
dddd8b8    to
    2e12fd8      
    Compare
  
    Maybe we should keep the nulls.
2e12fd8    to
    fe5fefc      
    Compare
  
    
  This was referenced Jun 9, 2025 
      
      
        
      
      
  
    17 tasks
  
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  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.
  
    
  
    
I noticed that the ThirdPartyComponent in the fixture was showing the wrong stack and the
"use third-party"is in the wrong location.When creating the initial JSX inside the third party server, we should make sure that it has no owner. In a real cross-server environment you get this by default by just executing in different context. But since the fixture example is inside the same AsyncLocalStorage as the parent it already has an owner which gets transferred. So we should make sure that were we create the JSX has no owner to simulate this.
When we then parse a null owner on the receiving side, we replace its owner/stack with the owner/stack of the call to
createFrom...to connect them. This worked fine with only two environments. The bug was that when we did this and then transferred the result to a third environment we took the original parsed stack trace. We should instead parse a new one from the replaced stack in the current environment.The second bug was that the
"use third-party"badge ends up in the wrong place when we do this kind of thing. Because the stack of the thing entering the new environment is the call tocreateFrom...which is in the old environment even though the component itself executes in the new environment. So to see if there's a change we should be comparing the current environment of the task to the owner's environment instead of the next environment after the task.After: