-
Notifications
You must be signed in to change notification settings - Fork 18
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
Create extraction interface #3
Comments
I agree, but I think it should follow the So maybe instead of
and then |
In current form I was trying to avoid collisions in HTML of two pages and minify memory usage, that's why it's just pulling only title and container's data. And now I think it should be improved to make it possible to load pages with different structure, for injecting things like viewport meta tag ( While type Page = {
head: String,
content: String,
expires: Date,
props: CustomProps,
}
type CustomProps = {[key:String]: Boolean|Number|String|Object|Array}
type ExtractCallback = (url: String, headers: Map, body: Uint8Array) => Page
type PrerenderCallback = (page: Page) => Page The Will it cover your needs? |
So the The issue that would exist with custom props, etc is that you'd have to remove them on unload. This is tricky. Turbolinks merges the head. But I think that's overkill. I think it's probably safe to assume that the head will be similar across pages. Maybe the extraction interface should just contain more data, and let the dev do what they want with it. Keep the content loading fairly unnopinionated. |
CustomProps is just a key-value storage which developer could use on rendering stage. Thus develop only decides what and how will be stored and rendered. As I think it intersects with your suggestion to let developer decide what to do. I just want to make extracted data structured well. In this case developer could store everything stringified in head and content props or as structured data in custom props. |
Create content extraction interface. It should receive html and return an object with:
The list could be extended.
The text was updated successfully, but these errors were encountered: