google / google-api-javascript-client

Google APIs Client Library for browser JavaScript, aka gapi.
Apache License 2.0
3.19k stars 1.05k forks source link

Release un-minified version of js client #211

Open futuro opened 8 years ago

futuro commented 8 years ago

Can we get an un-minified, readable version of the js client? The documentation on developers.google.com is chaotic/semi-inscrutable and I have, several times, tried to read through the client.js file to understand what's going on. Having a human-readable version would be helpful.

yk1711 commented 8 years ago

+1

trustedjohn commented 8 years ago

+1!

ianschmitz commented 8 years ago

+1

sergiocallegari commented 8 years ago

Possibly api.js too? This seems to be completely undocumented.

bsittler commented 8 years ago

I'm certainly excited to see the interest here! What goal (or goals) are you hoping to reach more easily by way of un-minified, readable source for the js client and api.js? Are there any specific shortcomings in the documentation you would like to see addressed?

futuro commented 7 years ago

Unfortunately back when I wrote this up I didn't give concrete examples of what I hoped to achieve, so the exact details have escaped me, but here's what I do remember.

Navigating the documentation was an IX nightmare, from finding the documentation for dealing with what part of the Google suite I wanted to work with, to then understanding how the various bits of those libraries fit together. For example, to get a users profile info I came across documentation that talked about gapi.profile but that didn't work, then I found gapi.plus which also failed, and ultimately I discovered that it's under gapi.client.oauth2.userinfo.get. While this makes sense in a way, the path to finding it felt like a fever dream as I jumped from doc page to doc page.

Ultimately the issues I've run into boil down to a lack of sign-posting and an information structure that I can't really parse and doesn't ultimately seem to have any apparent hierarchy. I don't mean that it doesn't, per se, or that people haven't put time and effort into it, but that I couldn't ever figure out what the hierarchy was supposed to be or how to place each doc section in context with the rest of the docs. I ultimately ended up memorizing what different docs for dealing with the calendar api looked like and bookmarking them, because they both had a mix of accurate and inaccurate data.

So part of what I hope for from having legible source is to be able to work around the IX woes I had with the docs, and then also for easier discoverability. For example, it's not really clear what values client.load accepts, and there's nowhere online that I could find which laid it out. Having the source might help with that.

I'd also mention that the fact that some products, such as the calendar, live under the gapi.client namespace while others, like youtube, seem to live just under gapi adds to the confusion, as I can't discern why calendar is considered "client" code but youtube isn't.

That's a bit long, but I hope it lays out what I'd like to get from an un-obfuscated source release. Please let me know if there's anything I can help with.

Thank you

P.S. As a side note for anyone having trouble with the auth libraries coming from a google search, know that you need to load platform.js with https://apis.google.com/js/client:platform.js, then gapi.load the "auth2" lib. Top level user info is in the gapi.client.oauth2 lib (use the v2 version), and your auth tokens are in gapi.auth2.getAuthInstance().currentUser.get().getAuthResponse() This may have changed

cjhowedev commented 6 years ago

Having an unminified version helps a ton with debugging. I can minify it myself and include source maps this way, for example. When you have an error pointing to some minified code, it’s massively frustrating to not be able to debug without very careful Googling.

Maxim-Mazurok commented 2 years ago

There's a work in progress Un-minified GAPI project, feel free to check it out and contribute