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

NW.js to Electron.js migration #894

Merged
merged 19 commits into from
Dec 21, 2016
Merged

NW.js to Electron.js migration #894

merged 19 commits into from
Dec 21, 2016

Conversation

weblancaster
Copy link
Member

@weblancaster weblancaster commented Oct 14, 2016

I might be forgetting something so I'm going to add as I go.

@weblancaster weblancaster changed the title electron migration NW.js tp Electron.js migration Oct 14, 2016
@ghost
Copy link

ghost commented Oct 14, 2016 via email

@weblancaster
Copy link
Member Author

and use what @wb9688 ?

@ghost
Copy link

ghost commented Oct 14, 2016

I don't know, the authentication part that's currently in Soundnode always looked like a hack to me…

@weblancaster
Copy link
Member Author

It is a hack.. but there is no other way because Soundcloud expect the third party to have a domain.

@bardiharborow
Copy link

bardiharborow commented Oct 16, 2016

I came here to look at what's being done, but the changes are cluttered by a huge amount of style changes. Is there a reason these are included in this particular PR?

@weblancaster
Copy link
Member Author

@bardiharborow I updated the editorconfig file so now the design of line spaces is different, if that's what you are asking though.

@weblancaster weblancaster changed the title NW.js tp Electron.js migration NW.js to Electron.js migration Oct 16, 2016
@weblancaster weblancaster mentioned this pull request Oct 27, 2016
- All nw.js references are now replaced
- Angular app can bootstrap
- Code refactoring was done to get modules loading correctly.
- Replace custom window management to a third party module removing the need to do it "manually".
- Remove all grunt tasks
- Add npm script tasks
- Remove jshint since eslint is being used
- Fix window/app action buttons
- Improve webpack config
@weblancaster
Copy link
Member Author

@wb9688 @Pitros @jakejarrett It's all migrated but would be nice if any of you could test it out.
I will be testing today and tomorrow.

Here are the files for Mac, Win and Linux https://www.dropbox.com/sh/vkyq4jbr9ol1mpg/AABHzCFPoFHes8G_Y5k2Fy9Va?dl=0 (the rate limit is being reached pretty easily this days though so you might have issues playing tracks)

To build locally you just need to run npm run build if you are notusing windows you will need to install wine https://www.davidbaumgold.com/tutorials/wine-mac/

that's it. thanks.

@jakejarrett
Copy link
Member

jakejarrett commented Oct 30, 2016

@weblancaster on linux build, i am unable to use some custom shortcuts that were previously present (Scaling & devtools)

@ghost
Copy link

ghost commented Oct 31, 2016 via email

@weblancaster
Copy link
Member Author

@jakejarrett hm yeah I removed some shortcuts and did not notice, I'm going to add back once I get a chance.

@weblancaster
Copy link
Member Author

@wb9688 @Pitros @jakejarrett I have updated the build on dropbox if you are not building locally.

@jakejarrett the scale down/up works normally on mac

@SW1FT
Copy link

SW1FT commented Nov 5, 2016

@weblancaster I just tried the Win build but I can't seem to be able to login. It just shows a white rectangle popup along with another white box popup saying "This popup should automatically close in a few seconds" after entering my SC account details.

@weblancaster
Copy link
Member Author

@SW1FT I'm going to check here

@TheNightRider12
Copy link

@wb9688 I will let you know when I get home from school. Give me about 2hrs

@TheNightRider12
Copy link

@jakejarrett I will give That a try when I get home from school

@weblancaster
Copy link
Member Author

@Legitgamer264 try log out and then log back in. The ngModel:numfmtwill show up but you will be able to login.

@TheNightRider12
Copy link

@weblancaster I am able to get the Minimize, X, and settings, etc buttons to appear. But I still can't play any track. Is this still because of the API? It's been a few days since I was able to play a track

@ghost
Copy link

ghost commented Dec 17, 2016

@Legitgamer264: Soundnode doesn't use the localStorage for getting the Client ID and Access Token in this Electron version, instead it uses the following code:

const fs = require('fs');
const userConfig = JSON.parse(fs.readFileSync(`${__dirname}/userConfig.json`, 'utf-8'));

// set window access token
window.scAccessToken = userConfig.accessToken;

// set window clientId
window.scClientId = userConfig.clientId

Which means there's a userConfig.json file that stores the Client ID and Access Token…

Btw don't share your Access Token, because then everyone is able to log in as you…

@weblancaster
Copy link
Member Author

@Legitgamer264 yes usually by 3pm CST Soundnode reached the API limit already so then just in the next day.

Weekends not as much people use so you will be able to use for longer (mostly during the mornings and beginning of the afternoon).

@ghost
Copy link

ghost commented Dec 17, 2016

@weblancaster: Can you make npm run clean able to run on Windows? Windows doesn't have the rm command, so you should use something like rimraf

@weblancaster
Copy link
Member Author

@wb9688 good point.. going to do that today. thanks.

@TheNightRider12
Copy link

@wb9688 do you have any idea when your python script will be fixed to work with the electron build?

@weblancaster
Copy link
Member Author

@Legitgamer264 try changing the clientId here with yours https://github.com/Soundnode/soundnode-app/blob/electron-migration/main.js#L14

@TheNightRider12
Copy link

@weblancaster I got it to work. But you have to also change app/public/js/system/userConfig.json, and put in the AccessToken and ClientId in that file too. That along with changing the clientID in main.js will work

@weblancaster
Copy link
Member Author

@Legitgamer264 I'm adding the accessToken and clientId to userConfig.json.

You can take a look here https://github.com/Soundnode/soundnode-app/blob/electron-migration/main.js#L73

@weblancaster
Copy link
Member Author

I have pushed new commits so if anyone wants to test please pull latest. thanks.

@TheNightRider12
Copy link

I will pull the latest when I get home

@TheNightRider12
Copy link

TheNightRider12 commented Dec 19, 2016

@weblancaster When I logged out and went to sign back in, I get this window - http://i.imgur.com/pw3JiNP.png
I checked and the userConfig.json is not in app/public/js/system
but I looked into the main.js and if I have the general idea of the code, if the userConfig doesn't exist isn't it supposed to open up the authentication window?

@TheNightRider12
Copy link

@wb9688 so what would the script be to get the clientID and accessToken for the electron build? since that is the one I am using at this time

@ghost
Copy link

ghost commented Dec 19, 2016 via email

@TheNightRider12
Copy link

@wb9688 thank you. I have ran the script and copied the access token and clientID into the userConfig, and I changed the clientID in the main.js file too but whenever I package the app up and then run the exe, I still get the API limit error. idk what I am doing wrong

@ghost
Copy link

ghost commented Dec 19, 2016

@Legitgamer264: The errors show a Client ID in the URLs, is that one the same as the one you just copied from my Python script?

@TheNightRider12
Copy link

@wb9688 I am using the same clientID that I get from your script. Same with the access token. I put the accessToken and ClientID in the userConfig located in (for me) soundnode-app\dist\Soundnode\Soundnode-win32-x64\resources\app\app\public\js\system

@TheNightRider12
Copy link

TheNightRider12 commented Dec 19, 2016

@weblancaster I think I found the issue on why the clientID and accesstokens that I get from the python script aren't working. I tried the build on my laptop, before the update on 12/19, and I was able to play songs just fine. But when I pulled the latest electron from today, that is when I got the API limit error. I am not sure which of the changes that were made that caused it to not work. But I know its the latest update from today that is causing it. I am pretty sure of that.
Edit - my laptop is on the electron build, just not the latest one. my desktop is on the latest electron and that is causing the issue

@kokarn
Copy link

kokarn commented Dec 20, 2016 via email

@weblancaster
Copy link
Member Author

Merging this work in master since soon or later that will happen and we are not changing anything in master.

@weblancaster weblancaster merged commit dfe8184 into master Dec 21, 2016
@weblancaster
Copy link
Member Author

weblancaster commented Jan 11, 2017

Master has latest fixes which I'm going to release a test version tonight for anyone who is interested. Or just build from master if you don't want/need to wait for me to release.

@weblancaster weblancaster deleted the electron-migration branch July 19, 2017 23:38
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.

8 participants