Skip to content

Support React Native 0.80.0 #1195

@jbroma

Description

@jbroma

Description

Currently, RN 0.80 is not supported because of new flow syntax that was introduced in the newest release, which results in the following error:

% npm run start             
npm warn Unknown user config "python". This will stop working in the next major version of npm.

> RepackApp@0.0.1 start
> react-native start


▄▀▀▀ ▀▀▀▀   █▀▀█ █▀▀█ ▄▀▀▀ █  █
█    ▀▀▀▀   █▀▀▀ █▀▀█ █    █▀▀▄
▀    ▀▀▀▀ ▀ ▀    ▀  ▀  ▀▀▀ ▀  ▀
5.1.2, powered by Rspack

 r: Reload app
 d: Open developer menu
 j: Open debugger
 a: Run adb reverse

Press Ctrl+c or Ctrl+z to quit the dev server

ℹ [16:28:27.550Z][DevServer] Server listening at http://[::1]:8081 
ℹ [16:28:27.551Z][DevServer] Server listening at http://127.0.0.1:8081 
ℹ [16:28:27.551Z][DevServer] Starting build for platforms: ios, android 
✖ [16:28:30.430Z][LoggerPlugin] Failed to build bundle due to errors 
✖ [16:28:30.430Z][LoggerPlugin] Error in "./node_modules/@react-native/virtualized-lists/Lists/VirtualizedSectionList.js":
  × Module build failed:
  ├─▶   ×   × Expected a semicolon
  │     │      ╭─[/workspace/src/node_modules/@react-native/virtualized-lists/Lists/VirtualizedSectionList.js:613:1]
  │     │  610 │   );
  │     │  611 │ }
  │     │  612 │
  │     │  613 │ const VirtualizedSectionListComponent = VirtualizedSectionList    component
  │     │      ·                                                                   ─────────
  │     │  614 │
  │     │  615 │
  │     │  616 │
  │     │      ╰────
  │     │
  │   
  ╰─▶ Syntax Error
 
✖ [16:28:30.436Z][LoggerPlugin] Failed to build bundle due to errors 
✖ [16:28:30.436Z][LoggerPlugin] Error in "./node_modules/@react-native/virtualized-lists/Lists/VirtualizedSectionList.js":
  × Module build failed:
  ├─▶   ×   × Expected a semicolon
  │     │      ╭─[/workspace/RepackApp/node_modules/@react-native/virtualized-lists/Lists/VirtualizedSectionList.js:613:1]
  │     │  610 │   );
  │     │  611 │ }
  │     │  612 │
  │     │  613 │ const VirtualizedSectionListComponent = VirtualizedSectionList    component
  │     │      ·                                                                   ─────────
  │     │  614 │
  │     │  615 │
  │     │  616 │
  │     │      ╰────
  │     │
  │   
  ╰─▶ Syntax Error

Currently, this needs patching of @react-native/virtualized-lists and removing the special component<> syntax as shown here: #1179 (reply in thread)

Related issues & discussions:
#1179
#1193

After that is fixed, we should also explore if there are any runtime incompatibilites.

Suggested solution

  • - needs fixes in flow-remove-types - handling of component<> syntax
  • - declare explicit support in versions.json in @callstack/repack/init

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureProposal or idea for a new feature or enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions