ProjectMirador / research-and-demos

Proofs of concept for Mirador 3
10 stars 8 forks source link

Integrate Manifesto into example app #38

Closed sdellis closed 6 years ago

sdellis commented 6 years ago

@aeschylus mentioned that Manifesto has a Promise that is used when fetching manifests, and wondered how we want to handle that.

One way I have dealt with this is to bypass Manifesto's fetch function and use manifesto.create with a stringified version of the manifest. This is demonstrated in some old Figgy code that used this approach.*

I also extend Manifesto in that example by mixing in my own functions to the instance (aka, "manifestation") so that I can return data in the structure I want, but also retain access to all Manifesto's functions on that instance. This abstracts away any data structuring that can make the component code overly complex if it requires props in a different format. For example, you can see that the manifestation.imageCollection() function returns only the data I need from the manifest to do manipulations to the canvases referenced.

* This is old because Figgy no longer uses manifests for "write" features due to the complexity of mapping sammelband front-end (IIIF) and back-end (Figgy) models.

mejackreed commented 6 years ago

Manifesto adds 177kb to existing 155kb production build.

sdellis commented 6 years ago

Wow. That's big! I wonder if it's possible to use decomposition / treeshaking to import only what we need from Manifesto.

There are also a few things that we may not need in dependencies... dev tools, sass stuff, etc.