-
Notifications
You must be signed in to change notification settings - Fork 10
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
[RFC] Build Time Data Injection #115
Comments
In working on #127, I noticed that a similar issue was occurring and so wanted to capture those thoughts here to ensure concentration of the subject matter. Essentially, the issue with the In other words, doing this (essentially) <eve-meta .attributes="${metadata}"></eve-meta> means that regardless of what the initial contents of To continue from the description of this issue then, I think it's becoming clearer that the app-template and / or page-template make the most sense for "piercing the membrane" so to speak. Essentially, to take the existing component and just move it from scaffolding, would like this: import { metadata } from 'xxx';
import { html, LitElement } from 'lit-element';
...
class AppComponent extends LitElement {
render() {
return html`
<eve-meta .attributes=${metadata}>
MYROUTES
<lit-route><h1>404 Not found</h1></lit-route>
`;
}
}
customElements.define('eve-app', AppComponent); This frees up the CLI and no more swapping files in and out, and still keeps the So, that aside, and also looping in #17, is what we want the API of this tool to really be, because it seems like it should comes down to, how much do we want rely on rendering in the browser? The more complex the app, the longer the build times? Or as long as components all define a Otherwise, if we have custom plugins, they might be able to serialize at build time (no browser) but would probably be specific to just Greenwood. With the above approach, maybe in custom element / lit element would work no problem? 🤞 |
Another thought: by moving |
Another related topic is that of hydration. In regards to #128 for example, one thing I notice with current implementation is of course that being that So basically, maybe just a development related thing, depending on how reliable our puppeteer implementation can be. |
Would also be good to be able to define data via frontmatter, e.g. ---
template: 'blog'
date: '2019-09-01'
title: 'Blog Post Title'
--- Would help a lot in this project and would allow more (all?) of the logic to happen in the template |
Type of Change
Summary
As a precursor to something like #21 , being able to pass data from build time to runtime is a critical API for Greenwood to provide.
Details
A good example of where this could be useful now is in how the items and subitem are configured for the Shelf component.
Currently the pages and links are determined by hardcoding a list of items and subitems in a JSON file in www/templates/page-template.js
So an example of how Greenwood could help with this is by being able to pass information from the build, like the graph.
Crossing this membrane is essentially how eventually external data and plugins can operate and provide dynamic information at build time, for the run time.
The text was updated successfully, but these errors were encountered: