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

Reorganize .R files around endpoints? #303

Open
jmobrien opened this issue Dec 19, 2022 · 2 comments
Open

Reorganize .R files around endpoints? #303

jmobrien opened this issue Dec 19, 2022 · 2 comments

Comments

@jmobrien
Copy link
Collaborator

I've been thinking about the need to revamp URL generation for #294, the number of new and pending new functions, and the casual discussion about where to place new things such as in #299 and/or #302. Also was doing some things over at haven that had me looking at a recent organization change.

Got me wondering if we might do well to start a file structure that organizes functions differently. Currently wondering about organizing files around major API endpoints, like the ones for surveys, responses, and mailing lists.

Related potential ideas, pretty independent so could consider separately:

  • organize files by major endpoint groups
  • files also have endpoint-associated info/functions that guide url building (since this might help with swapping out to mock servers for tests, and/or can be re-used to build new functions.)
  • check functions unique to specific endpoints/functions go in section in same file for easier review/management
  • general-purpose check functions folded into utils.R to reduce clutter (delete checks.R)
  • others?
@juliasilge
Copy link
Collaborator

Oh yeah, I think this package could do with some refactoring and reorganization. I personally find it hard to locate something at times! I think utils.R has way too much in it, and we should have a file for request building, a file for result parsing, etc.

Like you said, not all of this has to be done at once; some gradual improvements would really get us a better maintenance experience.

@jmobrien
Copy link
Collaborator Author

Yeah, I cut down utils.R a lot in the last reorganize, and it's still got a lot. Okay. I'll poke at it as I finish up some of this other stuff.

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

No branches or pull requests

2 participants