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

Fixes for expo-router app generation and issues with master merge up #2772

Merged
merged 15 commits into from
Sep 12, 2024

Conversation

lindboe
Copy link
Contributor

@lindboe lindboe commented Sep 11, 2024

Please verify the following:

  • yarn test jest tests pass with new tests, if relevant
  • yarn lint eslint checks pass with new code, if relevant
  • yarn format:check prettier checks pass with new code, if relevant
  • README.md (or relevant documentation) has been updated with your changes

Describe your PR

We found some issues with paths when generating a new app with expo-router enabled. To make this easier to manage, I added @ as an alias to consistently refer to the root app directory, whether it's app or src (depending on react-navigation vs. expo-router).

This still requires us to transform some files, but much fewer. I also left test files out of the path alias configuration for now, because we have a separate test-tsconfig file and we don't immediately need to fix that, but I'd love to remove that separate configuration in the future.

I also found:

  1. Merged up i18n work did not remove all lines needed for demo removal, and generated app had compile errors
  2. Tests on this branch and another were failing inconsistently; to address, I updated the tests to log all of stdout when tests fail so we are able to directly see the error message of what went wrong. This could probably be prettier, but it's an improvement for now.
  3. Generative tests that were using bun were failing because the react-native-drawer-layout patch wasn't getting removed, and this I'm pretty confused by. It did originally work and fixed tests that were failing prior, so I'm not sure what went wrong. Fixed in this PR here: 03bbc7a.

I'm concluding that it's extra important to make PRs for merging up changes from master at this point because v10 now has a lot more tests for making sure the generated app has no errors.

@lindboe
Copy link
Contributor Author

lindboe commented Sep 11, 2024

@frankcalise I'm getting this type error in App.tsx with the changes you made to the app component.

I'm not sure what the desired interface here looks like to reconcile this and still work for expo-router. Do you know how you'd like to fix this?

Screenshot 2024-09-11 at 10 59 34 AM

@lindboe lindboe changed the title Lindboe/check router app Fixes for expo-router app generation and issues with master merge up Sep 11, 2024
@lindboe lindboe force-pushed the lindboe/check-router-app branch 2 times, most recently from 675ff0b to 59ff2a3 Compare September 11, 2024 23:11
@lindboe lindboe requested a review from fpena September 11, 2024 23:14
@lindboe lindboe marked this pull request as ready for review September 11, 2024 23:14
@lindboe
Copy link
Contributor Author

lindboe commented Sep 11, 2024

@fpena I think I've fixed every reproducible error I can find, check out this branch and let me know how it goes for you

Copy link
Collaborator

@fpena fpena left a comment

Choose a reason for hiding this comment

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

Looks good! Just left 1 non-blocking question.

"src/devtools/ReactotronConfig.ts",
"src/components/Toggle/Switch.tsx",
"src/components/ListView.tsx",
"test/setup.ts",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Curious: Why are we removing the 3 lines on the left?

Copy link
Contributor

Choose a reason for hiding this comment

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

Because the alias was updated so there are less specific changes to files that are necessary. Before the changes were very specific and didn't scale well, now @lindboe has adjusted the path alias in tsconfig and we don't have to do so many transformations across the source files (whether they're in app/ or src/) - less maintenance for us.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In addition, the test files are still in there because there's a separate TS config, but if we can unify those better we can also update the test files automatically. But I'm planning on circling back to that in a later change.

Copy link
Contributor

@frankcalise frankcalise left a comment

Choose a reason for hiding this comment

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

Much cleaner and looks to be more future proof, well done!

"src/devtools/ReactotronConfig.ts",
"src/components/Toggle/Switch.tsx",
"src/components/ListView.tsx",
"test/setup.ts",
Copy link
Contributor

Choose a reason for hiding this comment

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

Because the alias was updated so there are less specific changes to files that are necessary. Before the changes were very specific and didn't scale well, now @lindboe has adjusted the path alias in tsconfig and we don't have to do so many transformations across the source files (whether they're in app/ or src/) - less maintenance for us.

These lines weren't getting removed in demo and failed tests. Did we not
have a test for removing demo and compiling?
I'm confused about this one, it appeared to work and printed
`patches/patch.patch` originally, but now the path isn't including the
directory. So added a new CWD to make sure the file gets deleted,
otherwise bun fails.
...from the test it was copied from
Potential issue with buffer size. Update to use spawn later so we can
stream output.
@lindboe lindboe merged commit b1cb6c3 into v10 Sep 12, 2024
1 check passed
@lindboe lindboe deleted the lindboe/check-router-app branch September 12, 2024 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants