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

#287 Upgrade next to v15 #289

Merged
merged 13 commits into from
Jan 14, 2025
Merged

Conversation

nevendyulgerov
Copy link
Contributor

@nevendyulgerov nevendyulgerov commented Jan 3, 2025

I upgraded next to v15 and react to v19 for the web app which resulted in library upgrades in:

  • packages/ui - upgraded the react and testing-library versions
  • apps/workshop - upgraded the react and storybook versions

I also tested the app through the docker container and didn't find any issues.

Additionally, I disabled all metamask e2e tests as those continue to be flaky. I'll look into those issues in upcoming tasks.

@nevendyulgerov nevendyulgerov added the Type: Chore Improvements to the code base and DX. It has no impact on external users e.g. Update deps label Jan 3, 2025
@nevendyulgerov nevendyulgerov self-assigned this Jan 3, 2025
Copy link

vercel bot commented Jan 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rollups-explorer-arbitrum-mainnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2025 10:23am
rollups-explorer-arbitrum-sepolia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2025 10:23am
rollups-explorer-base-mainnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2025 10:23am
rollups-explorer-base-sepolia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2025 10:23am
rollups-explorer-mainnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2025 10:23am
rollups-explorer-optimism-mainnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2025 10:23am
rollups-explorer-optimism-sepolia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2025 10:23am
rollups-explorer-sepolia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2025 10:23am
rollups-explorer-workshop ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2025 10:23am

export const useElementVisibility = <T extends Element>({
element,
export const useElementVisibility = (
element: HTMLDivElement | null,
Copy link
Collaborator

@brunomenezes brunomenezes Jan 9, 2025

Choose a reason for hiding this comment

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

That is an odd type narrowing saying that the only element type accepted would be div elements or null. But in theory, it was supposed to accept any valid HTML element or null. I checked the code and played around, and it would take a ref typed as HTMLInputElement without any squiggly red lines (the project is using typescript 5.3.2), which causes other problems in terms of modifying that hook as the intellisense will display incorrect attributes.

I believe the element being a generic type that extends the correct ParentType is necessary. The refactoring going down one level i.e. RefObject<T> to Element does not look like a problem.

Copy link
Collaborator

@brunomenezes brunomenezes Jan 12, 2025

Choose a reason for hiding this comment

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

Hey @nevendyulgerov, I am not saying to put it back to what it was (like you're doing here with a bit of difference cbf28cb). As I mentioned refactoring to one level down by receiving the HtmlElement or null instead of the RefObject is fine, but my highlighting was about the type narrowing to Div, instead of a more generic one e.g. by using generics.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, @brunomenezes , I'm not sure I understand. The code does use generics as it did before with the changes done in cbf28cb.

Please let me know if you want further changes related to this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

To clarify further, the comment was not about the refactoring from the object param to the function param, just the type narrowing.

@nevendyulgerov nevendyulgerov merged commit c6485fb into main Jan 14, 2025
24 checks passed
@nevendyulgerov nevendyulgerov deleted the feature/287-upgrade-next-to-v15 branch January 14, 2025 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Chore Improvements to the code base and DX. It has no impact on external users e.g. Update deps
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade Next to v15
2 participants