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

Add example for Next.js #5108

Merged
merged 14 commits into from
Sep 22, 2023
Merged

Conversation

bartlomiejbloniarz
Copy link
Contributor

@bartlomiejbloniarz bartlomiejbloniarz commented Sep 21, 2023

Summary

This PR adds an example with Next.js and a CI to test build fails. It is intended to prevent using api that is only available in a browser (w.g. window) without an appropriate check. This ensures that reanimated can be used with SSG.

Test plan

Build the example with yarn build and start with yarn start. You can also start it in dev mode using yarn dev and check if it responds changes in reanimated core.

Copy link
Collaborator

@tjzel tjzel left a comment

Choose a reason for hiding this comment

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

Requesting changes in blanco

@bartlomiejbloniarz bartlomiejbloniarz marked this pull request as ready for review September 22, 2023 09:29
Copy link
Member

@piaskowyk piaskowyk left a comment

Choose a reason for hiding this comment

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

🚀

@bartlomiejbloniarz bartlomiejbloniarz added this pull request to the merge queue Sep 22, 2023
Merged via the queue into main with commit 0467edb Sep 22, 2023
@bartlomiejbloniarz bartlomiejbloniarz deleted the @bartlomiejbloniarz/add-next-ci branch September 22, 2023 13:29
@nandorojo
Copy link
Contributor

FYI – the optimal setup for Next.js / web to confirm tree shaking would be to get rid of shouldBeUseWeb() which is used in many places in favor of platform-based files (index.web.ts). This would ensure what we aren't importing any unused variables or using conditional declarations for things in the wrong places. It would result in more files but be far more resilient and less prone to tree shaking regressions.

@bartlomiejbloniarz
Copy link
Contributor Author

@nandorojo I am currently working on that in #5203

@nandorojo
Copy link
Contributor

Awesome, glad to see this getting attention.

Just left some comments.

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.

4 participants