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

Improve dependency management for higher-level rlay-ontology clients #109

Open
2 tasks
MichaelHirn opened this issue Sep 7, 2019 · 0 comments
Open
2 tasks
Assignees
Labels
enhancement New feature or request rlay-client-lib issues pertaining to @rlay/rlay-client-lib
Milestone

Comments

@MichaelHirn
Copy link
Contributor

MichaelHirn commented Sep 7, 2019

With the arrival of v0.2.0 it becomes easier (recommended) to separate application ontologies into their own npm package which exposes (if it should be reused in other packages) their auto-generated client. It is also custom behavior that these rlay-ontology packages expose their own classes which provide higher-level interfaces to their ontology. Example rlay-ontology package here: https://github.com/MichaelHirn/rlay-ontology-airtable

However, to consume these rlay-ontology packages i.e. require them in rlay-ontology packages and applications and use their ontology and high-level interfaces, is non trivial and requires manually changing the auto-generated client of the application.

To prevent that, we need to change two things:

  • integrating the schema of rlay-ontology packages
  • integrating the higher-level interfaces of rlay-ontology packages

Integrating the schema of rlay-ontology packages

The proposed solution is to update rlay-seed to produce an index of entityKey => entityPayload instead of entityKey => entityCID as it is currently implemented; an update of rlay-generate to only require the output of rlay-seed (and no path to any ontology file) or even work on the input of rlay-seed. Then rlay-ontology packages have to expose their src/ontology.js file which module.exports a rlay-seed JSON object. In the application that ontology JSON object can then be required and dropped into the imports attribute of its own rlay-seed JSON object. rlay-seed needs to accept payloads instead of only cids for its imports attribute.

If you want your rlay-ontology package to be required by other packages, you export the output of rlay-seed (aka. the ontology file's rlay-seed JSON object), otherwise don't.

Integrating the higher-level interfaces of rlay-ontology packages

A bit more unclear but orientate ourselves on plugin systems like those from babel, eslint, etc.

cc @hobofan

@MichaelHirn MichaelHirn added enhancement New feature or request rlay-client-lib issues pertaining to @rlay/rlay-client-lib labels Sep 7, 2019
@MichaelHirn MichaelHirn self-assigned this Sep 7, 2019
@MichaelHirn MichaelHirn changed the title WIP-Proposal: Improve mechanism for adding custom (higher-level) entity factories Improve dependency management for higher-level rlay-ontology clients Sep 13, 2019
@MichaelHirn MichaelHirn added this to the v0.3.0 milestone Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rlay-client-lib issues pertaining to @rlay/rlay-client-lib
Projects
None yet
Development

No branches or pull requests

1 participant