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

Separate into its own module. #3

Open
4 tasks
shahzeb1 opened this issue Apr 3, 2017 · 12 comments
Open
4 tasks

Separate into its own module. #3

shahzeb1 opened this issue Apr 3, 2017 · 12 comments

Comments

@shahzeb1
Copy link
Owner

shahzeb1 commented Apr 3, 2017

So right now mySC.js includes both the code for (a) interacting with SoundCloud (getting info / playing actual song) and (b) interacting with our UI (managing the play / pause button getting clicked.

(a) and (b) should be split up. (a) should be placed into its own soundcloud-player.js module. It should include the key functions which should allow for anyone to include the <script> and grab info / play music.

  • Separate mySC.js and soundcloud-player.js into two distinct files
  • Make it so that soundcloud-player.js includes all the soundcloud related functions
  • Write some unit tests for soundcloud-player.js
  • Update the README.md with the appropriate changes as to how to use the API functions from the soundcloud-player.js module.
@R3l4x3
Copy link
Contributor

R3l4x3 commented Apr 7, 2017

Which testing suite do you want to use?

@shahzeb1
Copy link
Owner Author

shahzeb1 commented Apr 7, 2017

That's a really good question. I don't have too much experience with any testing tool specifically, so I'm all ears. 👂

Open to any of these. I'm feeling QUnit because it handles our use-case pretty well, what about you?

@R3l4x3
Copy link
Contributor

R3l4x3 commented Apr 11, 2017

Okay, I'll take a look into this testing framework.

At the moment I'm separating the player in its own file. And I have just following question: Should we remove jQuery completely?

Everything we do with jQuery is easy with VanillaJS. Or would you like to keep it?

@shahzeb1
Copy link
Owner Author

shahzeb1 commented Apr 11, 2017

Should we remove jQuery completely?

Yes that's actually a great idea. As far as I can tell you are correct. Everything will be possible via vanilla JS. 😄

@PaulTFreedman
Copy link
Contributor

@shahzeb1 @R3l4x3 I'll probably start looking at this soon, let me know if I should hold off

@PaulTFreedman
Copy link
Contributor

@shahzeb1 I just want to make sure I'm clear on the ultimate goal of this project - are you aiming to have a set of javascript functions that would allow someone to easily create their own SoundCloud players? I.e. is your UI here just to showcase an example of what your javascript functionality allows?

I'm wondering what assumptions could be made about how this would be used, for example will there have to be an iframe with id="so"?

@shahzeb1
Copy link
Owner Author

@PaulTFreedman yes so the goal is to separate all the Sound Cloud related logic into it's own library (file). This will make testing these specific functions easier.

Anything related to the iFrame / Soundcloud should be placed in the new soundcloud-player.js

@R3l4x3
Copy link
Contributor

R3l4x3 commented Apr 19, 2017

@PaulTFreedman Feel free to looking at this 👍🏼

@PaulTFreedman
Copy link
Contributor

I've made an attempt at the separation on my fork but haven't written any tests or updated the README yet. I'm not sure when I'll next have time to look at them so I'd be OK with someone taking over that part.

@shahzeb1
Copy link
Owner Author

@PaulTFreedman hey playa, feel free to make a fork request with the work you currently have. We'll forsure look it over and see what's going on / how we can help you with the tests! 🙌

@tehlordvortex
Copy link

I see @PaulTFreedman has separated the SoundCloud logic and UI logic. But this dumps everything in the global namespace. I would like to add some code that detects the current operating environment and exports the functions appropriately (Node.JS, RequireJS etc).

@PaulTFreedman
Copy link
Contributor

@Vortex83 sounds good to me. I have started looking at writing unit tests using QUnit and Sinon but I can wait until you finish with that refactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants