Skip to content

🔥Not all methods could|should be updated #1001

@theKashey

Description

@theKashey

Each component consist of 2 different pieces:

  1. Class methods. They exists on prototype and could be updated just by replacing the old prototype by a new one.
  2. Class properties. Their initiation occurs in class constructor.

To update second ones RHL creates 2 components - old and new, then compares all descriptors.
Comparison ignores "objects", thus keeps state untouched, and updates functions and simple variables.

But that does mean "updates functions"?
It literally cast function toString and then eval that code in the context of Class.

The problem

Casting function toString defines what is it, not how it was created.
Before, RHL did update, only if "text" got changes, but it was changed #949 and now they always got updated.

This causes #995, #978, #969, #984

RHL have rights only to update "own" functions, but could not detect them.

Solution

  1. Revert v4 does not use updated non-React modules #949
  2. Update "arrow" functions only if text got changed. Or if "this" keysword is found inside (probably should fix v4 does not use updated non-React modules #949 back)
  3. Update bound class methods. Ie those ones, which names exists on prototype.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions