-
Notifications
You must be signed in to change notification settings - Fork 149
Remove "bytecodeFileName" concept from "microsoft/react-native" #183
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
Conversation
|
ebf1f17
to
35f4389
Compare
bytecodeFileName is used excusively by ChakraExecutor in react-native-windows, and diverges us from upstream. Remove the concept in favor of passing bytecodeFileName directly to the ChakraJsExecutorFactory at creation time. We currently use a single bytecode file per-instance , so we see no loss of functionality when moving to a 1:1 relationship between executor and bytecode file. Locally validated that Android NDK libs still build. Verified we can build react-native-windows after some small changes that must be commited separately.
35f4389
to
e175841
Compare
@hansenyy is added to the review. #Closed |
@vmoroz is added to the review. #Closed |
} else if (reactInstance) { | ||
reactInstance->loadScriptFromString(std::make_unique<NSDataBigString>(script), 0, | ||
sourceUrlStr.UTF8String, !async, ""); // TODO(OSS Candidate ISS#2710739) | ||
reactInstance->loadScriptFromString(std::make_unique<NSDataBigString>(script), 0, // TODO(OSS Candidate ISS#2710739) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the 0 here is for bundleVersion which still differs
Are you sure about this?: "We currently use a single bytecode file per-instance , so we see no loss of functionality when moving to a 1:1 relationship between executor and bytecode file." Don't we use platform bundles in devmain? I mean, I think this should still be done through calls directly to the executor, just checking that you have all the downstream changes thought through to devmain that would be required to land this change. |
This change will require a lot of downstream changes. Could you prepare them to be ready right after you submit this change? |
@vmoroz @acoates-ms I have a separate change ready to go for react-native-windows, and I don't believe we should cause breakage in devmain, though I may be missing something. I can send out a separate PR for that if interested, though it cannot be merged until we publish a new npm package from here. On the react-native-windows side, InstanceImpl seems to exclusively feed the bytecode filename from DevSettings to the ChakraExecutor. InstanceWrapper doesn't seem to expose a mechanism to set bytecodeFilename apart from DevSettings, so it seems like there's no interface changes unless something in devmain is using something at a lower level of abstraction. @hansenyy could you confirm? Related. I noticed something weird in CWinReactImpl::InitializeThis in devmain, where we have some logic to set bytecode filename in devSettings but never actually seem to use this. Is this just NYI, or should we have a bug on this? See "/reactnativehost/ReactImpl_Win.cpp:L190" (Guessing we can't put devmain code in public comments?) |
We currently determine bytecodeFileName when creating InstanceImpl, determined by the passed in DevSettings. This change makes it so that we pass the bytecodeFilename as an InstanceArg to the ChakraExecutorFactory instead of passing it through public JSInstance and JSExecutor APIs. This change is dependent on microsoft/react-native-macos#183 in react-native. Haven't tested this end-to-end yet (having issues doing it locally). Will get that sorted out before merging either PR, since we cannot rely on CI until we check in the RN change.
The devmain code you are referring to is obsolete. Instead, we call the loadApplication explicitly. Let's not discuss it in this public repo. I would expect that we change the JSExecutor to map the JS bundle to bytecode. I guess it is part of react-native-windows. In reply to: 548503903 [](ancestors = 548503903) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We currently determine bytecodeFileName when creating InstanceImpl, determined by the passed in DevSettings. This change makes it so that we pass the bytecodeFilename as an InstanceArg to the ChakraExecutorFactory instead of passing it through public JSInstance and JSExecutor APIs. This change is dependent on microsoft/react-native-macos#183 in react-native. Haven't tested this end-to-end yet (having issues doing it locally). Will get that sorted out before merging either PR, since we cannot rely on CI until we check in the RN change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to abandon this as is and revisit with something a bit more comprehensive. There are the platform bundle concerns that were brought up which necessitate some further changes, but I don't love the story we leave here for bytecode logic in general, where we have versioning left in ms/rn but path logic in devmain. This is further complicated by JSI executors moving to PreparedScriptStore, meaning we need to be intentional in making whatever we introduce easy to rip out. |
We currently determine bytecodeFileName when creating InstanceImpl, determined by the passed in DevSettings. This change makes it so that we pass the bytecodeFilename as an InstanceArg to the ChakraExecutorFactory instead of passing it through public JSInstance and JSExecutor APIs. This change is dependent on microsoft/react-native-macos#183 in react-native. Haven't tested this end-to-end yet (having issues doing it locally). Will get that sorted out before merging either PR, since we cannot rely on CI until we check in the RN change.
…#3591) * Update to react-native@0.60.0-microsoft.16 * Change files * Change files * Move bytecodeFileName setting to ChakraExecutorFactory We currently determine bytecodeFileName when creating InstanceImpl, determined by the passed in DevSettings. This change makes it so that we pass the bytecodeFilename as an InstanceArg to the ChakraExecutorFactory instead of passing it through public JSInstance and JSExecutor APIs. This change is dependent on microsoft/react-native-macos#183 in react-native. Haven't tested this end-to-end yet (having issues doing it locally). Will get that sorted out before merging either PR, since we cannot rely on CI until we check in the RN change. * Move from a static bytecodeFilename in DevSettings to a newly introduced ScriptByteCodeResolver, letting us inject some logic in how to determine bytecode from URIs. * Add ScriptMetadataMap for ChakraExecutor We're going to move to a new design for bytecode caching/prepared scripts when moving to JSI. In the meantime, we can reuse most of the existing ChakraExecutor bytecode and script versioning logic. Pass this association in as a map to DevSettings instead of piping it through each call. * Remove some more dead code * Use member DevSettings in InstanceImpl instead of dead parameter * Rename some things. Change the metadata map to be stored by value instead of pointer to avoid dual null states of empty map and actually null. This should be fine from a perf perspective since we don't have many bundles, and we avoid an extra heap allocation for the shared_ptr. * Update lockfile * Yarn format * UWP Build Fixes
Summary: Pull Request resolved: facebook#52317 Changelog: [Internal] - Update `react-native/debugger-frontend` from d95ac13...35c4630 Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](facebook/react-native-devtools-frontend@d95ac13...35c4630). ### Changelog | Commit | Author | Date/Time | Subject | | ------ | ------ | --------- | ------- | | [35c4630bd](facebook/react-native-devtools-frontend@35c4630bd) | Vitali Zaidman (vzaidman@gmail.com) | 2025-06-26T09:47:45+01:00 | [track stack trace symbolication failures (microsoft#183)](facebook/react-native-devtools-frontend@35c4630bd) | | [e4487ef2e](facebook/react-native-devtools-frontend@e4487ef2e) | Vitali Zaidman (vzaidman@gmail.com) | 2025-06-24T14:29:35+01:00 | [support symbolication with native frames (microsoft#181)](facebook/react-native-devtools-frontend@e4487ef2e) | Reviewed By: huntie Differential Revision: D77437936 fbshipit-source-id: 5b64195064aa5e157ae1adad01a3f2dc94045f98
Summary
bytecodeFileName is used excusively by ChakraExecutor in react-native-windows, and diverges us from upstream. Remove the concept in favor of passing bytecodeFileName directly to the ChakraJsExecutorFactory at creation time. We currently use a single bytecode file per-instance , so we see no loss of functionality when moving to a 1:1 relationship between executor and bytecode file.
Locally validated that Android NDK libs still build. Verified we can build react-native-windows after some small changes that must be commited separately.
Please select one of the following
Microsoft Reviewers: Open in CodeFlow