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

Add proposal "Publication Helpers and Services" #131

Merged
merged 8 commits into from
Aug 8, 2020
Merged

Add proposal "Publication Helpers and Services" #131

merged 8 commits into from
Aug 8, 2020

Conversation

mickael-menu
Copy link
Member

Our goal is to improve extensibility and customizability of the Publication type for reading apps. To achieve that, this proposal introduces two structured ways to extend a Publication with additional features: helpers and services.

  • Helpers are internal extensions. They have a single implementation which is statically defined in the shared model types.
  • Services are external extensions. Other Readium components are providing their implementations, which are swappable and injected dynamically into the Publication object

See the formatted version here.

@mickael-menu mickael-menu marked this pull request as ready for review May 10, 2020 16:22
@mickael-menu
Copy link
Member Author

mickael-menu commented May 13, 2020

This proposal was approved in today's meeting, I'll leave it opened a few more weeks before merging it, if anyone wants to chime in before.

proposals/000-publication-helpers-services.md Outdated Show resolved Hide resolved

* `linksMatching(predicate: (Link) -> Boolean) -> Link?`
* Finds all the links matching the given `predicate` in the publication's `readingOrder`, `resources`, and `links` properties (in order).
* Delegates to `List<Link>::linksMatching()`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid providing List<Link> extensions would not look completely natural, since it would not be clear whether alternate links are checked or not (for me extending List suggests not).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to rewrite these helpers after we have a working proof-of-concept implementation.

@mickael-menu mickael-menu merged commit 24aa9a6 into readium:master Aug 8, 2020
@mickael-menu mickael-menu deleted the proposal/publication-helpers-services branch August 8, 2020 17:08
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

Successfully merging this pull request may close these issues.

None yet

2 participants