seanlaff
const Stargazers = () => {
const stargazers = van.state([]);
fetch(`https://api.github.com/repos/vanjs-org/van/stargazers?per_page=5`)
.then((r) => r.json())
.then((r) => stargazers.val = r);
return ul(
stargazers.val.map((s) => li(s.login))
);
}; import { useEffect, useState } from "react";
const GithubUser = ({ login, avatar_url, html_url }) => (
<div>
<img src={avatar_url} style={{width:40, height:40}}/>
<a href={html_url}>{login}</a>
</div>
);
export function App() {
const [stargazerResp, setStargazerResp] = useState([]);
const [repo, setRepo] = useState("vanjs-org/van");
useEffect(() => {
fetch(`https://api.github.com/repos/${repo}/stargazers?per_page=5`)
.then((r) => r.json())
.then((r) => Array.isArray(r) ? setStargazerResp(r) : setStargazerResp([]));
}, [repo]);
return (
<div className="App">
<input value={repo} onChange={(e) => setRepo(e.target.value)} />
<ul>
{stargazerResp.map((s) => (
<li key={s.login}>
<GithubUser
login={s.login}
avatar_url={s.avatar_url}
html_url={s.html_url}
/>
</li>
))}
</ul>
</div>
);
}The stargazer example leaves me with questions like- are components both async and non-async? What if the component re-renders due to other state changes, is my network request fired more than once? Do I have a "component coloring" problem where once one subcomponent is async, the entire parent hierarchy has to be?
Im sure there's answers to these questions if I read the docs, but as a curious passer-byer an example mirroring this common ui pattern would answer a lot of questions for me!
curl "https://${GITLAB_URL}/api/v4/projects/${GITLAB_PROJECT}/pipelines/${GITLAB_PIPELINE}/jobs?per_page=100&private_token=${GITLAB_TOKEN}" | jq 'map([select(.started_at and .finished_at) | {name: (.stage + ": " + .name), cat: "PERF", ph: "B", pid: .pipeline.id, tid: .id, ts: (.started_at | sub("\\.[0-9]+Z$"; "Z") | fromdate \* 10e5)}, {name: (.stage + ": " + .name), cat: "PERF", ph: "E", pid: .pipeline.id, tid: .id, ts: (.finished_at | sub("\\.[0-9]+Z$"; "Z") | fromdate \* 10e5)}]) | flatten(1) | .[]' | jq -s > "${GITLAB_PIPELINE}-trace.txt"Im happy GQL brought api-contract-type-saftey to a wider audience, but it is similarly solved with swagger/OpenApi/protobuf/et al.
Folks may be interested in dgraph, which exposes a gql api and is not victim to the n+1 problem since it is actually a graph behind the scenes.
Over the last few years we've tried a lot of different techniques, eventually settling on using Vega with our own interaction layer ontop- but I'd like to give this a try. I'd love if this library handled the sizing of all the elements as vega would, but I understand the desire to keep this small... I browsed the entirety of the source code on my phone!
One of our use cases is streaming high frequency data- do you still see uPlot performing better than the alternatives in that scenario?
Things like dataloader exist but the behavior of your schema gets harder and harder to reason about when different caching mechanisms get thrown on top.
I think everyone agrees that the client facing api for GQL is fantastic... maybe that means graphdbs are the next wave :P
This has always felt pretty lame to me. GraphQL has the entire request as an AST, it should know how to batch without arbitrary "debounces" thrown everywhere which slow all requests.
The fact that GQL doesn't provide better constructs around batching/reducing seems like a major failure of its design.
There seems to be an overall trend towards more reactivity and I applaud Vue for taking a creative approach to that. Will it stay, and become the da facto paradigm to do webdev? Only time will tell, but I don’t think we should be afraid to experiment with it.
The Vue team have always been excellent stewards of the project. I’m sad to see so much negativity here :(