Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to latest react native #33

Open
joprice opened this issue Feb 4, 2021 · 6 comments
Open

update to latest react native #33

joprice opened this issue Feb 4, 2021 · 6 comments

Comments

@joprice
Copy link

joprice commented Feb 4, 2021

I noticed there's a branch that updated the react native version. I'm interested in using some new components like Pressable. Can I help out getting that one updated to the latest and releasing?

@f-f
Copy link
Owner

f-f commented Feb 5, 2021

@joprice can you link to the branch you mention?

@joprice
Copy link
Author

joprice commented Feb 5, 2021

I think I jumped to conclusions about the branch: I saw the 0.61.4 branch https://github.com/f-f/purescript-react-basic-native/blob/0.61.4/codegen/package.json, where the last commit is "upgraded to rn 0.6", and I assumed master was on 0.5 still. Still, it does look like the latest react-native is 0.63.4 and Pressable was added 0.63 in https://reactnative.dev/blog/2020/07/06/version-0.63.

@f-f
Copy link
Owner

f-f commented Feb 5, 2021

I see! My maintenance of this repo is limited to merging PRs, so if you'd like to upgrade I'd happily merge that. It should be enough to run the scripts in the codegen folder after upgrading the version in the package.json there

@joprice
Copy link
Author

joprice commented Feb 5, 2021

Ok I'll try that

@joprice
Copy link
Author

joprice commented Feb 5, 2021

Looks like a previously unhandled type has been used in the newer definitions:

purescript-react-basic-native/codegen/lib/parser.js:240
        default: throw ("Got a type that I don't know: " + ts.SyntaxKind[type.kind]);
                 ^
Got a type that I don't know: IntersectionType

Looks like it's failing on the following type, which now includes an intersection:

  export type SectionListData<ItemT, SectionT = DefaultSectionT> = SectionBase<ItemT, SectionT> & SectionT;

Whereas in the currently used version it looks like this:

  export interface SectionListData<ItemT> extends SectionBase<ItemT> {
      [key: string]: any;
  }

@joprice
Copy link
Author

joprice commented Feb 6, 2021

Just to see the scope of the changes in the latest version, I took the first element of the intersection type: (type as unknown as ts.IntersectionTypeNode).types[0] and recursively called handleTypes with it. That gave me this diff:

https://github.com/f-f/purescript-react-basic-native/compare/master...joprice:update63?expand=1

I noticed a few observations:

  • the wrong CSS type being used, from DOM instead of Native
  • some types missing like AccessibilityPropsName, FlexStyleAlignSelf, and Readonly are missing
    • I'm not sure if these are a bug in the codegen, or if they should be manually created
  • webview was moved to a separate module https://github.com/react-native-community/discussions-and-proposals/pull/3/files
  • some fields have breaking changes like accessibilityStates going from Array String to AccessibilityState

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants