debugger icon indicating copy to clipboard operation
debugger copied to clipboard

[flow] switch from PropTypes to Props

Open jasonLaster opened this issue 9 years ago • 25 comments

We would like to switch from using PropTypes to flow props because it gives us a lot more coverage. I switched the Tabs component and learned a lot in the process.

We've done most of them, and just have a few to go!

todolist

  • [x] Frames/index.js
  • [ ] CommandBar.js
  • [ ] TextSearch.js
  • [x] ProjectSearch/index.js
  • [ ] Editor/index.js
  • [ ] App.js

jasonLaster avatar May 03 '17 23:05 jasonLaster

Cool! Lemme try one! I'll take Footer

clarkbw avatar May 04 '17 03:05 clarkbw

I'll try one too.

AnshulMalik avatar May 04 '17 16:05 AnshulMalik

wondering how does it work, is props stripped down later? or converted to PropTypes by a transform? I have no flow experience, so I could have missed something here

Andarist avatar May 05 '17 19:05 Andarist

@Andarist it's stripped away. It's basically acknowledging that we're going to use flow and static type our code. Want to jump in and claim a file?

jasonLaster avatar May 05 '17 19:05 jasonLaster

Yeah, already cloned and looking at EventListeners and reading dev guides ;)

Would be cool if they could be transformed to PropTypes if u distribute this as module (whatever if umd, cjs or smth else). You might have switched to flow, consumers of this as library might not.

Andarist avatar May 05 '17 19:05 Andarist

@jasonLaster can try SearchBar next

Andarist avatar May 05 '17 23:05 Andarist

Go for it On Fri, May 5, 2017 at 7:34 PM Mateusz BurzyÅ„ski [email protected] wrote:

@jasonLaster https://github.com/jasonLaster can try SearchBar next

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/devtools-html/debugger.html/issues/2804#issuecomment-299598417, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPiYvUyxbAeWOJ7ayVnD3oTWYQwborgks5r27IagaJpZM4NQDrw .

jasonLaster avatar May 05 '17 23:05 jasonLaster

I'd to like to take up "Expressions"

sharathnarayanph avatar May 09 '17 15:05 sharathnarayanph

Im also working on HitMarker

Andarist avatar May 09 '17 16:05 Andarist

Thanks!

On Fri, May 19, 2017 at 11:48 AM Peter Schussheim [email protected] wrote:

@jasonLaster https://github.com/jasonlaster Starting work on shared/Popover

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/devtools-html/debugger.html/issues/2804#issuecomment-302739679, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPiYojxRvd4F0sCjN8Wt69Iggm_sApFks5r7bnLgaJpZM4NQDrw .

jasonLaster avatar May 19 '17 17:05 jasonLaster

Is this an updated list? I think I'll start with shared/Accordion and shared/Autocomplete.

anbarasiu avatar May 22 '17 13:05 anbarasiu

probably not, we try to keep it up to date :)

jasonLaster avatar May 22 '17 13:05 jasonLaster

I'll take Popover

ohana54 avatar Oct 01 '17 20:10 ohana54

I'll take CommandBar!

satiewaltz avatar Oct 03 '17 23:10 satiewaltz

@satiewaltz its yours

jasonLaster avatar Oct 03 '17 23:10 jasonLaster

@jasonLaster
Just thought I should make a note about this: I've been checking out the conversion to flow types issue in this project. Some components listed in that issue use the Context API for the shortcuts component. I've done some research into it - and it seems like a runtime type library is required to convert from contextTypes to flow types: https://github.com/codemix/flow-runtime. I think its something that should be noted in the issue when people make PRs that use that component.

satiewaltz avatar Oct 05 '17 23:10 satiewaltz

Thanks @satiewaltz, I'd be open to using flow-runtime as well. Thanks for the update. Also, it's okay not to type context :) we use it very sparingly.

jasonLaster avatar Oct 05 '17 23:10 jasonLaster

Did some checking

Primary Panes / Outline looks done Primary Panes / Sources - cannot find the file, has ist been (re-)moved? Secondary Panes / Breakpoints looks done and seems only be missing the checkmark in this ticket. Secondary Panes / Why Paused looks also done Shared / Button / Close looks also done Shared / ManagedTree looks also done Shared / ObjectInspector -> cannot find the file, has it been (re-)moved? (looks like it has been moved to another module) Secondary Panes / CommandBar has only contextTypes left

Looks line Primary Panes / Sources Tree ist the only file left that has to be transformed.

amelzer avatar Oct 08 '17 13:10 amelzer

@amelzer Note: CommandBar's contextTypes can only be switched out if a runtime type library is used like flow-runtime as noted earlier from when I was looking at it. Fortunately, only several components have contextTypes defined in them: it's all places that inherits context from the shortcuts component.

Maybe that component can be marked done unless there's an alternative way to convert it that I've missed?

satiewaltz avatar Oct 08 '17 17:10 satiewaltz

@satiewaltz Yes, I got that, that's why it is in this done-ish list :)

amelzer avatar Oct 09 '17 13:10 amelzer