rnx-kit icon indicating copy to clipboard operation
rnx-kit copied to clipboard

Use @react-native-communty/cli-plugin-metro project to bundling, and remove custom code in CLI and related packages

Open afoxman opened this issue 4 years ago • 3 comments

I created @rnx-kit/metro-service from code in @react-native-community/cli to give us immediate access to calling Metro programmatically.

Check with @react-native-community/cli devs -- grabbou specifically -- about factoring out the code that talks to metro.

afoxman avatar Jun 28 '21 08:06 afoxman

The code I separated out of @react-native-community/cli is the buildBundle API and all subordinate APIs and types.

See /packages/cli/src/commands/bundle/buildBundle.ts.

afoxman avatar Jun 28 '21 08:06 afoxman

Talked with some people on discord including a maintainer, and I got the nod to go ahead with refactoring bundling & config code into separate cli packages.

  • [x] Move bundling command logic into /packages/cli-bundle-api and submit PR. There was an ask to focus on the asset logic and leave the bundling "command" where it is. This makes sense, but I need to review so I don't lose any logic.
  • [x] Once approved, submit fixes on top from the this PR
  • [x] Also, submit a PR which exposes the Metro config loader (and dependencies) into /packages/metro-config
  • [x] Once released/published, make use of both packages in our CLI

PR: https://github.com/react-native-community/cli/pull/1447 @react-native-community/cli release version 6.1.0 includes the PR

afoxman avatar Jul 13 '21 17:07 afoxman

Still need to remove the custom code I added (copied) from @rnc community project. Now that it's all wrapped up and exposed through CLI, we should use that instead.

afoxman avatar Jun 01 '22 00:06 afoxman

For future reference, @react-native-community/[email protected] is equivalent to [email protected].

tido64 avatar Jul 21 '23 14:07 tido64

headsup: things have been moving around -> https://github.com/facebook/react-native/pull/38795

kelset avatar Aug 07 '23 14:08 kelset