GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Extract CLI out by grabbou · Pull Request #22174 · react/react-native

Conversation

@grabbou

@grabbou grabbou commented Nov 6, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Removes CLI and uses react-native-local-cli instead. Opening this PR to make sure tests are green and that all requires to local-cli are either removed or replaced with a new version.

Right now, the react-native-local-cli is synced with local-cli folder present in 0.57.0 of React Native. I will work on upgrading that shortly as we tried to make minimal changes to the CLI before it actually gets extracted.

Next steps:

  • Make sure react-native init works and new projects work w/o issues
  • CI is green
  • All call-sites to local-cli are replaced
  • Sync with latest master
  • Ship it!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

thymikee, dratwas, exced, MoKhajavi75, and patrickkempff reacted with thumbs up emoji kelset, jamonholmgren, and patrickkempff reacted with laugh emoji matei-radu reacted with hooray emoji
All reactions
  • 👍 5 reactions
  • 😄 3 reactions
  • 🎉 1 reaction
@grabbou
Extract CLI out and fix call-sites (some of them)
b84afe6
@grabbou
grabbou requested review from Kureev, hramos and shergin as code owners November 6, 2018 13:11
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. ✅pr adds tests labels Nov 6, 2018
@grabbou

grabbou commented Nov 6, 2018

Copy link
Copy Markdown
Contributor Author

Note: Android tests seem to be failing anyway - I am ignoring them locally on my machine too. Will report back once I find out. It's likely because this is super fresh PR based on latest master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@grabbou
Return CLI for global CLI
bf36177
@react-native-bot react-native-bot added the Core Team label Nov 6, 2018
@grabbou

grabbou commented Nov 6, 2018

Copy link
Copy Markdown
Contributor Author

react-native init works without issues. Latest updates required to make it work are present in CLI repository master branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@grabbou

grabbou commented Nov 6, 2018

Copy link
Copy Markdown
Contributor Author

CLI is now updated to the latest commit. I am going to work on it tomorrow. I need to set up proper CI tests for the CLI itself and make sure all the Flow/Unit tests are passing w/o issues.

We are moving in the right direction.

jamonholmgren and leonardoballand reacted with heart emoji
All reactions
  • ❤️ 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

elicwhite
elicwhite reviewed Nov 6, 2018
View reviewed changes
Comment thread package.json Outdated
@@ -191,6 +191,7 @@
"prop-types": "^15.5.8",
"react-clone-referenced-element": "^1.0.1",
"react-devtools-core": "^3.4.0",
"react-native-local-cli": "^0.57.0",

@elicwhite elicwhite Nov 6, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you expect that the CLI and react-native will continue to be versioned together?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

MoKhajavi75 reacted with thumbs up emoji MoKhajavi75 reacted with laugh emoji
All reactions
  • 👍 1 reaction
  • 😄 1 reaction

@grabbou grabbou Nov 7, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be defined. Did it really quick to demonstrate it on the CI. Since I don't plan on releasing CLI exactly at the time of the new React Native release (in fact, I would like to do it more often to fix critical issues faster and ship new improvements), it will be really hard to keep up the same number and not to cause confusion.

I guess we can start with 1.0.0 when the migration is over and the PR is ready.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@kelset kelset Nov 8, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with having separate versioning, but this means that the new repo must have a table of compatibility of some sort

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@grabbou grabbou Nov 8, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think it's needed at the beginning since React Native contains a dependency on CLI for now. It is similar to the way we handle Metro - it also doesn't have compatibility table on React Native.

However, I do think keeping a peerDependency is going to be the right choice to make it easier to sync CLI and React Native versions together.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@grabbou grabbou Nov 8, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I already published 1.0.0-alpha.0 version and updated this PR.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
grabbou added 3 commits November 7, 2018 14:56
@grabbou
Fix tests - transform new location of CLI
ecb6d98
@grabbou
Move bin property to react-native-local-cli
47e0658
@grabbou
Fix Jest tests - move assetPathUtils from CLI to here, RN should not …
586f54f
…require its files
grabbou
grabbou commented Nov 7, 2018
View reviewed changes
Comment thread Libraries/Image/assetPathUtils.js
* FIXME: using number to represent discrete scale numbers is fragile in essence because of
* floating point numbers imprecision.
*/
function getAndroidAssetSuffix(scale: number): string {

@grabbou grabbou Nov 7, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is now duplicated between React Native and React Native CLI. Shall we consider making it a separate package, e.g. react-native-cli-path-utils and publish to npm?

CC: @TheSavior

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@kelset kelset Nov 8, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel that to keep RN and the CLI separated but having them both using these utils the separate package option is a valid solution

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@grabbou grabbou Nov 8, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. For now, I think we can ship the copy and figure out this as a next PR. Problem with this one is that I need to update local-cli folder every time something changes which is very hard. Hopefully, we can get this reviewed ASAP.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@axe-fb axe-fb Nov 16, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this file is for more than just images, so it does need to be in RN, to be used by other asset types.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@grabbou
Bump dependency on React Native for review
5373544
@grabbou

grabbou commented Nov 8, 2018

Copy link
Copy Markdown
Contributor Author

Update: There's one last issue I need to fix related to Metro Bundler. Once that happens, this will be ready for review. I am hoping to do it by today.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@grabbou
Bump CLI version for review
af5e7cf
@grabbou

grabbou commented Nov 9, 2018

Copy link
Copy Markdown
Contributor Author

This pull request is ready to be reviewed.

I have tested it by:
a) running most of the commands manually confirming they work
b) making sure all tests pass (Flow & Jest)
c) running ./scripts/test-manual-e2e.sh and initing an RNDemoApp project to use the new CLI tools. It run w/o issues by invoking yarn react-native run-ios and yarn react-native start.

Migration strategy:

  • If you have a require call to local-cli folder, replace it with react-native-local-cli or consider removing entirely.

For every new release, we are going to verify that CLI works (by running step "c" from the above, which is exactly the same workflow we used to have) and if there are no issues, the peerDependency will be updated in the CLI or new version released to indicate the support. I expect small changes to happen as we put this into practice.

To Metro team:
Stick to your current approach where you bump Metro dependencies in React Native master and we will be following you inside react-native-cli. Ideally, you'd send a PR to this repository with bumped versions too and required changes to the API if any.

This is non-breaking and transparent change to users unless they were requiring files from local-cli (private API, not guaranteed to work). In this case, they just need to update imports.

The sooner we merge it, the easier it will be for us to keep up with changes that happen to CLI itself and React Native.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@grabbou

grabbou commented Nov 9, 2018

Copy link
Copy Markdown
Contributor Author

Note: We don't have to ship it in next RC. This commit can be easily excluded if it causes any concerns. It can also be easily cherry-picked to the next version.

kelset reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

grabbou added 2 commits November 9, 2018 14:19
@grabbou
Bump CLI dependency to fix tests
c200278
@grabbou
Fix CLI version
83ae4ba
@grabbou

grabbou commented Nov 9, 2018

Copy link
Copy Markdown
Contributor Author

Note: Once the PR is merged, I will work on:

  • all open PRs and ask authors to submit the same diff against react-native-cli instead
  • all open issues and move them to the react-native-cli where it makes sense
patrickkempff and jamonholmgren reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@grabbou
Bump CLI dependency
2287be4
@grabbou

grabbou commented Nov 9, 2018

Copy link
Copy Markdown
Contributor Author

Tests are green. Please ignore Appveyor error - I don't know why it happens.

patrickkempff, matei-radu, and jamonholmgren reacted with hooray emoji
All reactions
  • 🎉 3 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hramos hramos removed the ✅pr adds tests label Nov 14, 2018
axe-fb
axe-fb reviewed Nov 16, 2018
View reviewed changes
Comment thread local-cli/cli.js
require('../setupBabel')();

var cliEntry = require('./cliEntry');
var cli = require('react-native-local-cli');

@axe-fb axe-fb Nov 16, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit): why change the name of the variable ?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@grabbou grabbou Nov 18, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up overwriting this file with a local copy I created upfront. Not intentional, I can revert if needed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Libraries/Image/AssetSourceResolver.js
const PixelRatio = require('PixelRatio');
const Platform = require('Platform');

const assetPathUtils = require('../../local-cli/bundle/assetPathUtils');

@axe-fb axe-fb Nov 16, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assetPathUtils are not limited to images. They also impact all other types of assets.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@grabbou grabbou Nov 18, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but my understanding is that the "impact" is more present in the local-cli context where the utils are used to generate a path to any type of asset.

On the React Native side of things, this file is only used in Image module. Anyway, this shouldn't be an issue now that the local-cli folder will not be removed. I am going to revert this change and w can leave this to be refactored at some point.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Libraries/Image/assetPathUtils.js
@@ -10,7 +10,7 @@

'use strict';

import type {PackagerAsset} from '../../Libraries/Image/AssetRegistry';

@axe-fb axe-fb Nov 16, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if moving this utility and making it specific to Image makes sense. This is for all assets. Maybe this should be a separate util.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@grabbou grabbou Nov 18, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, not an issue that we leave local-cli. However, this is only used in Image module on the React Native side.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@grabbou grabbou mentioned this pull request Nov 18, 2018
Extract out CLI #22337
Closed
@grabbou

grabbou commented Nov 18, 2018

Copy link
Copy Markdown
Contributor Author

Closing in favor of #22337. We have decided to not remove local-cli folder, for now, to not break the code that relies on its private API and might be using it in some places.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@grabbou grabbou closed this Nov 18, 2018
facebook-github-bot pushed a commit that referenced this pull request Dec 3, 2018
@grabbou @facebook-github-bot
Extract out CLI (#22337)
cb6eb03
Summary:
Continuation of #22174 with an exception that `local-cli` folder is left in React Native repository to keep Facebook internal and React Native calls still working.

Separate strategy should be developed to remove all uses of `local-cli` in favor of dedicated utilities.
Pull Request resolved: #22337

Reviewed By: TheSavior

Differential Revision: D13172898

Pulled By: cpojer

fbshipit-source-id: 0217867f9944648307475ebe629eb729da7bfaaf
grabbou added a commit to react-native-community/cli that referenced this pull request Dec 3, 2018
@grabbou @facebook-github-bot
Extract out CLI (#22337)
3e633b0
Summary:
Continuation of react/react-native#22174 with an exception that `local-cli` folder is left in React Native repository to keep Facebook internal and React Native calls still working.

Separate strategy should be developed to remove all uses of `local-cli` in favor of dedicated utilities.
Pull Request resolved: react/react-native#22337

Reviewed By: TheSavior

Differential Revision: D13172898

Pulled By: cpojer

fbshipit-source-id: 0217867f9944648307475ebe629eb729da7bfaaf
@JAStanton

JAStanton commented Dec 13, 2018

Copy link
Copy Markdown
Contributor

@grabbou excuse my ignorance, but I see that local-cli has been removed in favor of react-native-local-cli which is published on npm but I cannot find the source anywhere? Is it in source control somewhere?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kelset

kelset commented Dec 13, 2018

Copy link
Copy Markdown
Contributor

@JAStanton you can find the repo here -> https://github.com/react-native-community/react-native-cli

And the original proposal -> react-native-community/discussions-and-proposals#13

grabbou reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JAStanton

JAStanton commented Dec 13, 2018 via email

Copy link
Copy Markdown
Contributor
Thank you!
…
On Thu, Dec 13, 2018 at 1:31 AM Lorenzo Sciandra ***@***.***> wrote: @JAStanton <https://github.com/JAStanton> you can find the repo here -> https://github.com/react-native-community/react-native-cli And the original proposal -> react-native-community/discussions-and-proposals#13 <react-native-community/discussions-and-proposals#13> — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#22174 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAnYtJZ1uZedmzKVqnn0_9ABi8CmZGxDks5u4h5-gaJpZM4YQakz> .
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zpao
zpao deleted the feat/extract-cli branch January 31, 2019 01:55
facebook-github-bot pushed a commit that referenced this pull request Sep 11, 2021
@rickhanlonii @facebook-github-bot
React Native sync for revisions bd5bf55...95d762e
7f7f818
Summary:
This sync includes the following changes:
- **[95d762e](react/react@95d762e40 )**: Remove duplicate test //<Andrew Clark>//
- **[d4d1dc0](react/react@d4d1dc085 )**: Reorder VARIANT feature flags ([#22266](react/react#22266)) //<Dan Abramov>//
- **[2f156ea](react/react@2f156eafb )**: Adjust consoleManagedByDevToolsDuringStrictMode feature flag ([#22253](react/react#22253)) //<Dan Abramov>//
- **[cfd8193](react/react@cfd819332 )**: Add useSyncExternalStore to react-debug-tools ([#22240](react/react#22240)) //<Andrew Clark>//
- **[8e80592](react/react@8e80592a3 )**: Remove state queue from useSyncExternalStore ([#22265](react/react#22265)) //<Andrew Clark>//
- **[06f98c1](react/react@06f98c168 )**: Implement useSyncExternalStore in Fiber ([#22239](react/react#22239)) //<Andrew Clark>//
- **[77912d9](react/react@77912d9a0 )**: Wire up the native API for useSyncExternalStore ([#22237](react/react#22237)) //<Andrew Clark>//
- **[031abd2](react/react@031abd24b )**: Add warning and test for useSyncExternalStore when getSnapshot isn't cached ([#22262](react/react#22262)) //<salazarm>//
- **[b8884de](react/react@b8884de24 )**: break up import keyword to avoid being accidentally parsed as dynamic import statement in external code ([#21918](react/react#21918)) //<Jianhua Zheng>//
- **[6d6bba5](react/react@6d6bba5bf )**: Fix typo in ReactUpdatePriority-test.js ([#21958](react/react#21958)) //<Ikko Ashimine>//
- **[0c0d1dd](react/react@0c0d1ddae )**: feat(eslint-plugin-react-hooks): support ESLint 8.x ([#22248](react/react#22248)) //<Michaël De Boey>//
- **[1314299](react/react@1314299c7 )**: Initial shim of useSyncExternalStore ([#22211](react/react#22211)) //<Andrew Clark>//
- **[fc40f02](react/react@fc40f02ad )**: Add consoleManagedByDevToolsDuringStrictMode feature flag in React Reconciler ([#22196](react/react#22196)) //<Luna Ruan>//
- **[46a0f05](react/react@46a0f050a )**: Set up use-sync-external-store package ([#22202](react/react#22202)) //<Andrew Clark>//
- **[8723e77](react/react@8723e772b )**: Fix a string interpolation typo in ReactHooks test ([#22174](react/react#22174)) //<Matt Hargett>//
- **[60a30cf](react/react@60a30cf32 )**: Console Logging for StrictMode Double Rendering ([#22030](react/react#22030)) //<Luna Ruan>//
- **[76bbad3](react/react@76bbad3e3 )**: Add maxYieldMs feature flag in Scheduler ([#22165](react/react#22165)) //<Ricky>//
- **[b0b53ae](react/react@b0b53ae2c )**: Add feature flags for scheduler experiments ([#22105](react/react#22105)) //<Ricky>//

Changelog:
[General][Changed] - React Native sync for revisions bd5bf55...95d762e

jest_e2e[run_all_tests]

Reviewed By: mdvacca

Differential Revision: D30809906

fbshipit-source-id: 131cfdf91e15f67fa59a5d925467e538ee89fe10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@elicwhite elicwhite elicwhite left review comments
@hramos hramos Awaiting requested review from hramos
@Kureev Kureev Awaiting requested review from Kureev
@shergin shergin Awaiting requested review from shergin
+2 more reviewers
@kelset kelset kelset left review comments
@axe-fb axe-fb axe-fb left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@grabbou @JAStanton @kelset @elicwhite @axe-fb @hramos @facebook-github-bot @react-native-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.