Workiva / Workiva/over_react

Support createRef fix/assist for usages outside of component classes

Open
#546 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-analyzer-plugin
Dominant language
Dart
Stars
432
Forks
57
PR merge metrics
No merged PRs in 30d

Description

  1. Support replacing callback refs that assign to fields that are local variables (potentially in parent functions) or top-level variables, in addition to class fields

    Element divRef;
    someMethod() {
      Element spanRef;
    
      return (Dom.div()..ref = ((ref) => divRef = ref))(
        (Dom.span()..ref = ((ref) => spanRef = ref))(
      );
    }
    
  2. Suggest createRef when outside of a component class, as a new variable in the closest function body

     method() {
    +  final divRef = createRef<Element>();
    +
       // some other logic
    -  return Dom.div()();    
    +  return (Dom.div()..ref = divRef)();    
     }
    

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is identified; first locate the existing createRef fix/assist implementation and its callback-ref handling. Exercise it with the two Dart examples, covering local and top-level assignments and a suggestion in the closest function body, and verify both transformations are supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.