Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore(site): enable React'sStrictMode#13399

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
aslilac merged 1 commit intomainfromreact-strict-mode
Jun 3, 2024
Merged

Conversation

aslilac
Copy link
Member

As we talked about last week: let's enable strict mode! might help us catch some bugs, shouldn't affect production users. :)

@Parkreiner
Copy link
Member

Parkreiner commentedMay 29, 2024
edited
Loading

Gonna start looking at this when I get back tomorrow, but one thing I'm going to double-check is our state (limiting non-deterministic inputs so that renders stay pure) and effects (making sure everything has a cleanup function if it makes sense)

Copy link
Collaborator

@BrunoQuaresmaBrunoQuaresma left a comment

Choose a reason for hiding this comment

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

I think it is ok to merge since integration and e2e tests are passing 👍

@Parkreiner
Copy link
Member

Parkreiner commentedMay 30, 2024
edited
Loading

Did a quick scan for our currentuseEffect calls, and a couple of concerns jumped out at me. To be clear, I don't know if these should block enablingStrictMode. These are bugs that our tests aren't catching, but the point ofStrictMode is to highlight that these bugs exist. The issues still exist for the end user, whether we're usingStrictMode or not

  • useProxyLatency
    • Doesn't clean up itsPerformanceObserver
    • Didn't read through the whole file, but my understanding is that each time the effect re-fires, we'll get a new observer that will keep updating state that we don't care about anymore
  • MonacoEditor
    • Not sure if we want to cancel remeasuring the fonts when the theme changes
  • TemplateVersionEditorPage
    • The TAR reader has a race condition when the data changes
      • Initialize the file tree for data 1 and kick off an async process for reading it
      • Data changes and kicks off a new effect, and we now do the same thing for data 2
      • Data 2 finishes reading and updates state first because it's shorter
      • Data 1 then finishes and updates state as well, writing stale data
  • WorkspaceBuildProgress
    • Doesn't clear out a timeout

@BrunoQuaresma
Copy link
Collaborator

@Parkreiner how did you find those issues? I'm very interested if you have some methodology for that.

@Parkreiner
Copy link
Member

Parkreiner commentedMay 30, 2024
edited
Loading

@Parkreiner how did you find those issues? I'm very interested if you have some methodology for that.

@BrunoQuaresma There's not really a methodology. All I did was do a search for the regexuse(?:Layout)Effect\((to find invocations instead of just import statements) and eyeballed the logic really quick

BrunoQuaresma reacted with thumbs up emoji

@aslilac
Copy link
MemberAuthor

@Parkreiner I created a new issue to track those issues. I'll look into them tomorrow, but it'll be as a separate PR.

@aslilacaslilac merged commit79fd736 intomainJun 3, 2024
29 checks passed
@aslilacaslilac deleted the react-strict-mode branchJune 3, 2024 16:03
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJun 3, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@BrunoQuaresmaBrunoQuaresmaBrunoQuaresma approved these changes

@ParkreinerParkreinerAwaiting requested review from Parkreiner

Assignees

@aslilacaslilac

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@aslilac@Parkreiner@BrunoQuaresma

[8]ページ先頭

©2009-2025 Movatter.jp