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

Add bundle progress bar to logs #140

Merged
merged 16 commits into from
Apr 21, 2017
Merged

Add bundle progress bar to logs #140

merged 16 commits into from
Apr 21, 2017

Conversation

brentvatne
Copy link
Member

@brentvatne brentvatne commented Mar 30, 2017

It works, see this image. Depends on facebook/react-native#13172

slack-imgs

Falls back to this on old SDKs

slack-imgs-1

"qrcode-terminal": "^0.11.0",
"xdl": "^37.0.0"
"xdl": "38.0.0-beta.2"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming we'll release this as at-latest before we merge this?

Copy link
Member Author

Choose a reason for hiding this comment

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

yup!

@@ -33,8 +33,9 @@
"match-require": "^2.0.0",
"minimist": "^1.2.0",
"path-exists": "^3.0.0",
"progress": "^1.1.8",
Copy link
Contributor

Choose a reason for hiding this comment

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

This issue concerns me re: windows support

Copy link
Member Author

Choose a reason for hiding this comment

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

indeed, I don't have a windows machine to test this :<

Copy link
Member Author

Choose a reason for hiding this comment

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

or rather I do but I have no idea how to use windows for anything except oculus and netflix

Copy link
Member Author

Choose a reason for hiding this comment

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

fwiw we use this same ProgressBar module on exp so this could be a problem we have to address there too if it is indeed true and not user error in that issue

Copy link
Contributor

Choose a reason for hiding this comment

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

ah ok. hm maybe it's broken in exp too then?

Copy link
Member Author

Choose a reason for hiding this comment

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

can you try out installing exp and init'ing a project? should show progress bar while downloading

Copy link
Contributor

Choose a reason for hiding this comment

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

wipes tear away while spinning up a VM

Copy link
Contributor

Choose a reason for hiding this comment

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

so apparently the inquirer package is also irrevocably broken on git bash, so i'm just going to step away slowly

Copy link
Member Author

Choose a reason for hiding this comment

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

resolution: don't support git bash for now if you want a pleasant crna experience. powershell recommended on windows for now. if anyone reading this is interested in fixing git bash support it would be welcome!

return;
}
if (packagerReady) {
const message = `${chunk.msg.trim()}\n`;
Copy link
Contributor

Choose a reason for hiding this comment

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

such template literal much wow

Copy link
Member Author

Choose a reason for hiding this comment

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

lol


let _bundleProgressBar;

function respectProgressBars(commitLogs) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The existence of this function makes me think that we also need to replace console.log's in other scripts, as there's a chance we may use, for example, the Expo login stuff inside of a script that needs to respect progress bars.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking about this more, we probably want to replace all of the console.log statements so that there's no confusion about when or where to use this?

Copy link
Member Author

Choose a reason for hiding this comment

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

@dikaiosune - so just:

let _oldConsoleLog = console.log;
console.log = log;

// implement log with _oldConsoleLog

Copy link
Contributor

Choose a reason for hiding this comment

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

wfm

@brentvatne brentvatne force-pushed the @brent/add-bundle-progress-bar branch from e80f488 to ecdf6cb Compare March 31, 2017 00:46
@brentvatne
Copy link
Member Author

ok I think I addressed everything. you can test this out by cloning and running npm pack in react-native-scripts then running create-react-native-app FancyApp --scripts-version /path/to/create-react-native-app/react-native-scripts/react-native-scripts-0.0.26.tgz -- I updated dependencies for each package required to make this work

@@ -1,5 +1,5 @@
{
"expo": {
"sdkVersion": "15.0.0"
"sdkVersion": "UNVERSIONED"
Copy link
Member Author

Choose a reason for hiding this comment

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

of course we will change this before merging, just changed it for now so you can test

@brentvatne
Copy link
Member Author

we can almost merge this @dikaiosune ;)

@anp
Copy link
Contributor

anp commented Apr 18, 2017

Woooooooo

Is it just waiting on sdk 16?

@anp
Copy link
Contributor

anp commented Apr 20, 2017

Not sure why it is showing changes vs. master that I rebased into the branch, but I'm testing this now.

@anp anp changed the title [DON'T MERGE] Add bundle progress bar to logs Add bundle progress bar to logs Apr 20, 2017
console.log(`Installing dependencies using ${command}...`);
console.log();
log(`Installing dependencies using ${command}...`);
log(); // why is this here
Copy link
Contributor

Choose a reason for hiding this comment

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

because it's ugly otherwise and i apparently forgot how newlines work

@anp anp merged commit 0f87f83 into master Apr 21, 2017
@anp anp deleted the @brent/add-bundle-progress-bar branch April 21, 2017 00:47
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

Successfully merging this pull request may close these issues.

3 participants