-
Notifications
You must be signed in to change notification settings - Fork 13
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
To what extent are we consistent w/ the python API? #13
Comments
i'm gonna go out on a limb and say no one is going to jump back and forth between using both of these libs extensively. if i'm wrong and a developer does use both, i think they'd actually appreciate the fact that the architecture of each library deviates in order to take advantage of the strengths of each language and that we've crafted each project using hard-fought wisdom. that said, at a level higher up, i think we should allocate time to document the surface area of each using a matrix to get them aligned with regard to parity in capabilities. if developers can navigate helpful examples that demonstrate that the puzzle pieces fit neatly together to execute common tasks, they'll consider the two libs consistent. |
Good point @jgravois - we will be at least functionally equivalent, and if there's a need to be syntactically equivalent then I suggest my idea above of adding a package that wraps the functional APIs in the other packages. To that end, from https://github.com/esridc/hub-py/wiki/Implemented-methods-and-its-usage here's what Hub.py currently does:
The main difference is that so far all the python functions are implicitly scoped to an organization b/c they hang off |
Spot on - the goals is to have capability parity and coherence. Both should be -ic (pythonic, js-ic), but consistent naming of parameters, defaults, methods when possible. Specific to the JS methods - can we use We will also need to support Create, Edit, Delete on things. This will be a priority for Urban. Create new initiative or Create initiative from template. I’m not sure if anyone in JS uses an IDE, but if we want Useful autocomplete, we should consider using the thing type, then operation e.g.:
|
JavaS-cryptic |
We just settled on using 'fetch' as a prefix b/c it's more descriptive of what it's going to do - implies async, etc. However that is inconsistent w/ Hub.py and arcgis-rest-js, so maybe going back to 'get' is better.
That only exists for parity w/ Hub.py, which is always scoped by Org, and is really just a convenience wrapper around
For most Hub entities (initiatives, sites, pages, events, etc) we'll need to handle this via a new Hub REST API. Once that is in place, this library can include calls to those end points. |
While it would be nice to mirror the Hub.py API, Python and JS are different languages, used in different contexts. For JS that runs in a browser, there is a real cost to adding bits that don't get used (like CRUD operations that won't get used in a read-only site), and potential memory leaks left around by objects that aren't destroyed. In those scenarios it's preferable to compose your application out of dependencies that expose stateless functions - like https://github.com/Esri/arcgis-rest-js/
If we need to mirror the Hub.py API, then maybe we just add a top level package to this repo that consumes the the libraries that expose stateless functions and exposes a
hatefulstateful API (const hub = new Hub(myCommunityOrgUrl)
) that does all the things.The text was updated successfully, but these errors were encountered: