Skip to content
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

Introduce Tuist in the Template #37952

Closed
wants to merge 1 commit into from

Conversation

cipolleschi
Copy link
Contributor

@cipolleschi cipolleschi commented Jun 18, 2023

Summary:

tuist.io is a tool that allows to describe the xcode project-related files using Swift, in a declarative way.

This tool solves the problem of working with the xcodeproj files completely, as it abstracts its details.

The xcodeproj is notoriously a painful file to work with, especially when multiple engineers works together on the same project, and it is also one of the main sources of frustration for our users when it comes to update an app.

This change introduce the Project.swift file for the template. However, currently, using tuist has to be done manually, as the RN CLI does not have knowledge of it. Therefore, to make everything work, we are going to commit all the files that tuist generates, to have an atomic commits that works.

Draft RFC: react-native-community/discussions-and-proposals#672 -> Read it formatted

Next Steps:

  1. update the CLI so that it can use tuist
  2. Remove the generated files from the template and add them to the .gitignore.
  3. update RN Doctor so that it knows about tuist

Changelog:

[iOS][Added] - Introduce tuist in the template

Differential Revision: D46711973

Summary:
[tuist.io](https://tuist.io) is a tool that allows to describe the xcode project-related files using Swift, in a declarative way.

This tool solves the problem of working with the xcodeproj files completely, as it abstracts its details.

The xcodeproj is notoriously a painful file to work with, especially when multiple engineers works together on the same project, and it is also one of the main sources of frustration for our users when it comes to update an app.

This change introduce the `Project.swift` file for the template. However, currently, using tuist has to be done manually, as the RN CLI does not have knowledge of it. Therefore, to make everything work, we are going to commit all the files that tuist generates, to have an atomic commits that works.

## Next Steps:
1. update the CLI so that it can use swift
2. Remove the generated files from the template and add them to the .gitignore.
3. update RN Doctor so that it knows about tuist

## Changelog:
[iOS][Added] - Introduce `tuist` in the template

Differential Revision: D46711973

fbshipit-source-id: dc904d52fba63198439b988a59c749c8ab55d4a8
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner fb-exported labels Jun 18, 2023
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46711973

@cipolleschi cipolleschi requested a review from fortmarek June 19, 2023 12:25
Copy link
Contributor

@fortmarek fortmarek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The integration looks good 👋 .pbxproj 👋

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file can be put into .gitignore. It's automatically generated and not something users should commit. Projects created with tuist init the whole Derived folder in .gitignore

Copy link
Contributor Author

@cipolleschi cipolleschi Jun 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, as I said in the Next Steps above:

Next Steps:

update the CLI so that it can use tuist
Remove the generated files from the template and add them to the .gitignore.
update RN Doctor so that it knows about tuist

The reason why they are not ignored now is to allow users to use the Xcodeproj without the need of installing tuist. The plan is to ignore them and remove the xcodeproj as soon as the CLI can handle Tuist properly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be gitignored, too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the plan to remove pbxproj later on?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. I don't want to remove it right away as it will break CIs that may be running test creating apps starting from the template.

sources: ["HelloWorld/*.m", "HelloWorld/*.mm"],
resources: [
"HelloWorld/Images.xcassets",
"HelloWorld/LaunchScreen.storyboard"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"HelloWorld/LaunchScreen.storyboard"],
"HelloWorld/LaunchScreen.storyboard"
],


let startPackagerScript =
"""
export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider putting this into a script file to make it easier to edit? Or do we rather want to keep the Xcode project as close as possible to what it used to be?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal will be to remove these scripts and have them in separate files.
However, I didn't want to push too many changes in a single sweep... 😅

@fortmarek
Copy link
Contributor

Should we also include the .tuist-version file (see more about it here)? Or do we expect the tuist version will be owned by the RN CLI?

@cipolleschi
Copy link
Contributor Author

Should we also include the .tuist-version file (see more about it here)? Or do we expect the tuist version will be owned by the RN CLI?

Good call, I forgot about this. It should be owned by the template, imho and the CLI should honour it.

Copy link

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 17, 2023
Copy link

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this Dec 24, 2023
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 p: Facebook Partner: Facebook Partner Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants