Skip to content

Upgrade to React 16.6 stable APIs #11360

Closed

Description

@youknowriad

Ideally, before upgrading, we can get rid of all deprecated APIs surfaced by StrictMode of React 16.6.

  • findDOMNode
  • The old contextAPI
  • componentWillReceiveProps and other lifecycle hooks.

Remaining instances (feel free to add items to the list when you notice used deprecated APIs)

Activity

  1. added
    Framework
    on Nov 1, 2018
  2. added this to the 4.3 milestone on Nov 1, 2018
  3. ellatrix commented on Nov 1, 2018

    @ellatrix
    Member

    There's a PR for the TinyMCE one: #8148.

  4. ellatrix commented on Nov 1, 2018

    @ellatrix
    Member

    I also see one for Resizable:

    react-dom.24169eaf.js:526 Warning: Unsafe lifecycle methods were found within a strict-mode tree:
        in Editor (created by ComponentWithSelect)
        in ComponentWithSelect
        in WithSelect(Editor)
    
    componentWillReceiveProps: Please update the following components to use static getDerivedStateFromProps instead: Resizable
    
    Learn more about this warning here:
    https://fb.me/react-strict-mode-warnings
    
  5. youknowriad commented on Nov 1, 2018

    @youknowriad
    ContributorAuthor

    @iseulde I saw it too, not sure where it come from yet but adding an item to the list above.

  6. oandregal commented on Nov 2, 2018

    @oandregal
    Member

    Riad, #11123 has been merged. Checked the task off from the list.

  7. youknowriad commented on Nov 6, 2018

    @youknowriad
    ContributorAuthor

    Remove componentWillUpdate from the Fill component

    @aduth when you have some time, I'd appreciate some help on this particular point

  8. modified the milestones: 4.3, 4.4 on Nov 7, 2018
  9. oandregal commented on Nov 12, 2018

    @oandregal
    Member

    Did not find anything related to the Resizable component, but searching for componentWillReceiveProps did yield one result: the Input leaf component of ColorPicker. I can look into that.

  10. modified the milestones: 4.4, WordPress 5.0 on Nov 13, 2018
  11. aduth commented on Nov 14, 2018

    @aduth
    Member

    Given the title of the issue, can this be assumed to be closed by #11840?

    Or should we update the title if there are remaining tasks?

  12. oandregal commented on Nov 14, 2018

    @oandregal
    Member

    I'd rename it to something along the lines of "Upgrade to React 16.6 stable APIs".

  13. changed the title [-]Upgrade to React 16.6[/-] [+]Upgrade to React 16.6 stable APIs[/+] on Nov 15, 2018
  14. 3 remaining items

  15. added this to the Future: 5.x milestone on Jan 9, 2019
  16. youknowriad commented on Feb 8, 2019

    @youknowriad
    ContributorAuthor

    Can we do a push to fix the remaining warnings here?

  17. coreymckrill commented on Mar 22, 2019

    @coreymckrill
    Contributor

    Looks like there is also usage of componentWillMount in the Latest Posts block. Would that fall within the scope of this issue?

  18. aduth commented on Mar 22, 2019

    @aduth
    Member

    Looks like there is also usage of componentWillMount in the Latest Posts block. Would that fall within the scope of this issue?

    I expect so, yes (and for any other occurrence of componentWillMount, if exists).

    Edit: Updated original comment.

  19. notnownikki commented on Mar 26, 2019

    @notnownikki
    Member

    PR for LatestPostsEdit is at #14637

  20. aduth commented on Apr 5, 2019

    @aduth
    Member

    Question: Will using the UNSAFE_-prefixed methods trigger StrictMode warnings? While I'd love to avoid them altogether, I'm personally more inclined to see us using development modes in E2E sooner than later to catch other, legitimate, present issues (related discussion).

    Edit: Follow-up issue for SCRIPT_DEBUG at #14845

  21. chiraggmodi commented on Apr 16, 2019

    @chiraggmodi

    any update on how to solve this issue?

  22. aduth commented on Apr 16, 2019

    @aduth
    Member

    @chiraggmodi The warnings logged from the React unsafe methods are not ideal, but are safe to ignore. This issue serves as to track progress from the task of updating individual components to avoid warnings being logged, as they are not future-compatible. Feel free to take on any of the items listed which have not been claimed, if you are able to assist in this upgrade.

  23. gziolo commented on May 9, 2019

    @gziolo
    Member

    It looks like componentWillUpdate in Fill component which blocks us from enabling SCRIPT_DEBUG in e2e tests env. Is anyone working on it?

  24. youknowriad commented on May 9, 2019

    @youknowriad
    ContributorAuthor

    I'd really want us to close this issue. I know the Fill issue is not easy though.
    Some people running WP in SCRIPT_DEBUG true are getting confused with these warnings.

  25. gziolo commented on May 9, 2019

    @gziolo
    Member

    I'd really want us to close this issue. I know the Fill issue is not easy though.
    Some people running WP in SCRIPT_DEBUG true are getting confused with these warnings.

    Has anyone tried using getSnapshotBeforeUpdate instead?

  26. youknowriad commented on May 21, 2019

    @youknowriad
    ContributorAuthor

    Most of the warnings are now gone when you open the editor. I'm going to close this at the moment. Let's consider any future warnings as bugs.

  27. aduth commented on May 22, 2019

    @aduth
    Member

    #14851 will resolve some StrictMode errors for Popover usage (findDOMNode). An issue should be created to remove all findDOMNode warnings caused as a result of using react-click-outside (remove react-click-outside in similar refactoring, only used elsewhere in Modal). Remind me to create this if I forget.

    #14845 should be considered a follow-up task here (enable development React and thereby StrictMode in end-to-end testing environments for error log capturing).

  28. youknowriad commented on May 23, 2019

    @youknowriad
    ContributorAuthor

    @aduth I created this #15790 to track the Modal refactoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Framework

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions