-
Notifications
You must be signed in to change notification settings - Fork 24.7k
[prebuild][iOS] building up to React Core #50766
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
[prebuild][iOS] building up to React Core #50766
Conversation
- Added multiple targets to Package.swift - WIP: Builds up untill we need to touch files in React/Base
- Added scripts for creating hardlinks to resolve headers - Added multiple packages and dependencies
- Added hermes download - Added codegen - Tried resolving some more packages
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.
I still have to go through the Package.swift file, but I'm leaving a few comments on the JS part.
- First it runs codegen - Then it downloads hermes (if needed) - Then it creates hard links
…folders - Now uses fs.linkSync to link each file. This makes the output a bit cleaner as well. - Removed parameter specifying library in codegen.
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.
Amazing work, thank you so much!
I left a few minor comments on things that might need to be adjusted or that are not needed. And then we can look at how we can simplify the Package.swift. But I'm super happy that we got here!
link('React/CxxUtils', 'CxxUtils', 'React'); | ||
link('React/DevSupport', 'DevSupport', 'React'); | ||
link('React/Inspector', 'Inspector', 'React'); | ||
link('React/I18n', 'I18n', 'React'); |
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.
this scares me a little bit. We should verify that i18n keeps working after we build.
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.
Yes, we need to solve including the strings as well - I haven't looked at it yet.
This target does not need to be built, it is for the app only.
Added abstractions and removed complex include file generation
- Combined hermesprebuilt + hermesIncludes - Removed duplicate include paths to the compiler - Removed version number for hermes in package.swift
- Made deps named and not by reference (due to order of initialization) - Fixed issue in utils.js.
5b91784
to
c73ebc5
Compare
class RNTarget: BaseTarget { | ||
let linkedFrameworks: [String] | ||
let excludedPaths: [String] | ||
let dependencies: [String] |
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.
wouldn't be easier if this is already a [BaseTarget]
instead of a [String]
?
We already have the targets so we can pass them right into the other targets.
In this way, we can avoid the
let dependencies = self.dependencies.compactMap { depName in
targets.first(where: { $0.name == depName })
}
below
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.
Tried it, but there’s a sneaky issue with non-initialized variables that was hard to debug where you can use a non-initialized target before it is declared. Then its name and props aren’t initialized and the dependencies weren’t resolved properly. It could be fixed with changing the order so that we never used an uninitialized target, but the moment someone added a new target and forgot this they’d have to try to find this bug all over again. So I thought it would be safest to use the name we already had to avoid this.
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.
yeah, in this case the order we use to define the variables is important, as it is important with any kind of program. We can keep it like it is for now.
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.
Absolutely :) :) I think I'd just had enough with things I had to look out for at this moment and found going for strings would be safer - and hopefully save us some work in the future.
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: This change adds a script to sdownload the hermes artifact and to prepare it for building react Native using SwiftPM bypass-github-export-checks ## Changelog: [INTERNAL] - Add script to download the hermes artifact Pull Request resolved: facebook#50766 Test Plan: This will be tested in a diff in the stack. Differential Revision: D74386522
Summary: - Added multiple targets to Package.swift - WIP: Builds up untill we need to touch files in React/Base ## Changelog: [INTERNAL] - WIP: prebuilding using Swift packages Pull Request resolved: facebook#50766 Test Plan: This will be tested in a diff in the stack. Differential Revision: D74386522
Summary: - Added multiple targets to Package.swift - WIP: Builds up untill we need to touch files in React/Base ## Changelog: [INTERNAL] - WIP: prebuilding using Swift packages Pull Request resolved: facebook#50766 Test Plan: This will be tested in a diff in the stack. Differential Revision: D74386522 Pulled By: cipolleschi
Summary: - Added multiple targets to Package.swift - WIP: Builds up untill we need to touch files in React/Base ## Changelog: [INTERNAL] - WIP: prebuilding using Swift packages Pull Request resolved: facebook#50766 Test Plan: This will be tested in a diff in the stack. Differential Revision: D74386522 Pulled By: cipolleschi
Summary: - Added multiple targets to Package.swift - WIP: Builds up untill we need to touch files in React/Base ## Changelog: [INTERNAL] - WIP: prebuilding using Swift packages Pull Request resolved: facebook#50766 Test Plan: This will be tested in a diff in the stack. Differential Revision: D74386522 Pulled By: cipolleschi
Summary: - Added multiple targets to Package.swift - WIP: Builds up untill we need to touch files in React/Base ## Changelog: [INTERNAL] - WIP: prebuilding using Swift packages Pull Request resolved: facebook#50766 Test Plan: This will be tested in a diff in the stack. Differential Revision: D74386522 Pulled By: cipolleschi
Summary: - Added multiple targets to Package.swift - WIP: Builds up untill we need to touch files in React/Base ## Changelog: [INTERNAL] - WIP: prebuilding using Swift packages Pull Request resolved: facebook#50766 Test Plan: This will be tested in a diff in the stack. Differential Revision: D74386522 Reviewed By: cortinico Pulled By: cipolleschi
@cipolleschi merged this pull request in 43bfb5d. |
This pull request was successfully merged by @chrfalch in 43bfb5d When will my fix make it into a release? | How to file a pick request? |
Summary:
Changelog:
[INTERNAL] - WIP: prebuilding using Swift packages
Test Plan
Build Package.swift in Xcode for now