profile
viewpoint

GoogleChromeLabs/quicklink 8424

⚡️Faster subsequent page-loads by prefetching in-viewport links during idle time

guess-js/guess 6373

🔮 Libraries & tools for enabling Machine Learning driven user-experiences on the web

KyleAMathews/blog 109

my blog!

bvaughn/react 13

A declarative, efficient, and flexible JavaScript library for building user interfaces.

KyleAMathews/aiocalendar 6

All-in-one calendar feature built in Drupal

davad/fsapi 4

Drupal api wrapper module around php-fsapi to let drupal modules access familysearch

KyleAMathews/atrium_book 2

port of atrium_book to Eduglu, KIT-complient, likely soon to be superceeded by new atrium_book version

KyleAMathews/awesome-gatsby 2

⚛️ 📄 🚀 Awesome list for the mighty Gatsby.js, a blazing fast React static site generator.

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): speedup recipe runs for recipes with large numbers of resources

 const recipeMachine = Machine(         }       }),       addResourcesToContext: assign((context, event) => {-        if (event.data) {+        if (lodash.isArray(event.data) && event.data.length > 0) {

we already use lodash elsewhere

KyleAMathews

comment created time in 7 hours

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 20462114e923c955b5adb01dac98f3e7f7e4b36e

Don't shadow import

view details

push time in 7 hours

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): speedup recipe runs for recipes with large numbers of resources

 const render = (recipe, cb, inputs = {}, isApply, isStream, name) => {     }   } -  const throttledRenderResources = lodash.throttle(renderResources, 30, {+  const throttledRenderResources = lodash.throttle(renderResources, 100, {     trailing: false,   })    queue.on(`task_finish`, function (taskId, r, stats) {     throttledRenderResources() -    const resources = transformToPlan(result)     emitter.emit(`update`, resources)

ah thanks for this, fixing

KyleAMathews

comment created time in 7 hours

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 566f7ca76a2d1b43e7ace89e4e56ec40c3be6f9e

try make CI work

view details

push time in 18 hours

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 4a76785ad676ce79a22d99a05a49c88727501b3d

Add TODO

view details

push time in 20 hours

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): speedup recipe runs for recipes with large numbers of resources

 const handleResource = (resourceName, context, props) => {   }    let allResources = useResourceContext()-  const error = validateResource(resourceName, context, props)-  if (error) {-    const result = {-      error: `Validation error: ${error.details[0].message}`,+  if (!errorCache.has(trueKey)) {

cache validation

KyleAMathews

comment created time in 21 hours

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): speedup recipe runs for recipes with large numbers of resources

 const render = (recipe, cb, inputs = {}, isApply, isStream, name) => {     }   } -  const throttledRenderResources = lodash.throttle(renderResources, 30, {+  const throttledRenderResources = lodash.throttle(renderResources, 100, {

don't call reconcilier as often

KyleAMathews

comment created time in 21 hours

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 6540374a7a5cbf65c1666fb9f2aa46e8c4043ecb

Remove debugging code

view details

push time in 21 hours

PR opened gatsbyjs/gatsby

fix(gatsby-recipes): speedup recipe runs for recipes with large numbers of resources
  • share validation cche
  • run reconcilier less often
+34 -27

0 comment

3 changed files

pr created time in a day

create barnchgatsbyjs/gatsby

branch : recipe-speedups

created branch time in a day

issue openedvadimdemedes/ink

what to do when a view gets longer than the screen as it flickers badly on updates

ink-flickering

Is there any easy way to detect when this is happening so we can take corrective measures?

created time in a day

Pull request review commentgatsbyjs/gatsby

feat(gatsby-recipes): live stream updates from creating resources

 const pubsub = new PubSub() const PORT = process.argv[2] || 50400  let lastState = {}+let lastDone = 0 const emitUpdate = state => {   // eslint-disable-next-line no-unused-vars   const { lastEvent, ...cleanedState } = state-  if (!lodash.isEqual(cleanedState, lastState)) {+  // isEqual doesn't handle values on objects in arrays 🤷‍♀️+  const newDone = cleanedState.context.plan.filter(r => r.isDone).length

done

KyleAMathews

comment created time in a day

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha a1f8a5054d52b1ccc704a91c292e8360043847f4

chore(release): Publish - gatsby-admin@0.1.126 - gatsby-cli@2.12.80 - gatsby-recipes@0.2.10 - gatsby@2.24.37

view details

push time in a day

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 57843f7d50797533ac0e267f420178baf4d4696f

feat(gatsby-recipes): live stream updates from creating resources (#26283) * feat(gatsby-recipes): live stream updates from creating resources * don't exit rendering until queue has drained * change var name * Trivial change to get ci going again * Start tests again... * skip flaky test * Small cleanups suggested by @johno * fix rendering * Add another check for render doneness for validation failure

view details

push time in a day

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha c19196158e2e44b3686d4e7c3330673d7e752733

Small cleanups suggested by @johno

view details

Kyle Mathews

commit sha 54872ed8f7bb4c4e5797c9a6a690afb8011832f5

fix rendering

view details

Kyle Mathews

commit sha 762817198b054e313f643f57ef587961900ba93a

Add another check for render doneness for validation failure

view details

push time in 2 days

pull request commentgatsbyjs/gatsby

File System support for creating redirects

yeah most traditional CMSs and some headless CMSs have this baked in — it's very common to be moving pages around when you're a content/marketer person & these systems will automatically create redirects for you

On Fri, Aug 7, 2020 at 12:21 PM Blaine Kasten notifications@github.com wrote:

another consideration is that redirects often come from the data layer or from direct API calls — a static file isn't useful there as the list of redirects isn't stored in git. =

I had not considered this at all! This could definitely impact and change this API. Do we have examples of this? Like does wordpress allow you to define redirects in their UI that we would need to support?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gatsbyjs/gatsby/pull/26292#issuecomment-670673905, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAARLBY6XNITMJTLAES7YRTR7RH3JANCNFSM4PX5CPOQ .

blainekasten

comment created time in 2 days

pull request commentgatsbyjs/gatsby

File System support for creating redirects

another consideration is that redirects often come from the data layer or from direct API calls — a static file isn't useful there as the list of redirects isn't stored in git. =

On Fri, Aug 7, 2020 at 12:07 PM Blaine Kasten notifications@github.com wrote:

@KyleAMathews https://github.com/KyleAMathews we could consider that! Here are my rough thoughts and things we would have to consider when doing that:

  1. gatsby-config can already get sort of long, adding redirects there might not feel that much better than just doing it in gatsby-node
  2. gatsby-config is a JS file, which makes it harder to extract. If they import things from other files it's going to be much harder for us to read the redirects

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gatsbyjs/gatsby/pull/26292#issuecomment-670668028, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAARLB535UK2KPYQFL24L3LR7RGF7ANCNFSM4PX5CPOQ .

blainekasten

comment created time in 2 days

Pull request review commentgatsbyjs/gatsby

feat(gatsby-recipes): live stream updates from creating resources

 const handleResource = (resourceName, context, props) => {    inFlightCache.set(cacheKey, promise) -  queue.add(() => promise)+  queue.push(promise)    throw promise } -const render = async (recipe, cb, inputs = {}, isApply) => {+const render = (recipe, cb, inputs = {}, isApply, isStream, name) => {+  const emitter = mitt()   const plan = {} +  const queue = new Queue(+    async (job, cb) => {+      const result = await job+      cb(null, result)+    },+    { concurrent: 5 }+  )++  queue.push(new Promise(resolve => resolve()))

ugh :-( this is testing code left over — I'll remove this + add the compare function

KyleAMathews

comment created time in 2 days

pull request commentgatsbyjs/gatsby

File System support for creating redirects

hmm why not in gatsby-config.js?

blainekasten

comment created time in 2 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha ae43bb10fc7d739f8ed029553ca266955969c156

skip flaky test

view details

push time in 2 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 34418dd01de26a21bd4b60dc75dde8b39df13ec7

Start tests again...

view details

push time in 2 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha bdfd829f750088f161972dbf16b5824a92ef21fb

Trivial change to get ci going again

view details

push time in 2 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha d7414532a279dbbca5f856bbf8e5ee34f7c8726d

change var name

view details

push time in 2 days

Pull request review commentgatsbyjs/gatsby

feat(gatsby-recipes): live stream updates from creating resources

 const handleResource = (resourceName, context, props) => {    inFlightCache.set(cacheKey, promise) -  queue.add(() => promise)+  queue.push(promise)    throw promise } -const render = async (recipe, cb, inputs = {}, isApply) => {+const render = (recipe, cb, inputs = {}, isApply, isStream, name) => {+  const emitter = mitt()   const plan = {} +  const queue = new Queue(+    async (job, cb) => {+      const result = await job+      cb(null, result)+    },+    { concurrent: 5 }+  )++  queue.push(new Promise(resolve => resolve()))++  const resultCache = new Map()+  const inFlightCache = new Map()++  let result+   const recipeWithWrapper = (-    <Wrapper inputs={inputs} isApply={isApply}>+    <Wrapper+      inputs={inputs}+      isApply={isApply}+      resultCache={resultCache}+      inFlightCache={inFlightCache}+      queue={queue}+    >       {recipe}     </Wrapper>   ) -  const renderResources = async () => {-    queue.pause()+  // Keep calling render until there's remaining resources to render.+  // This let's resources that depend on other resources to pause until one finishes.+  const renderResources = isDrained => {+    result = RecipesReconciler.render(recipeWithWrapper, plan, name)++    // If there's still nothing on the queue that means we're done.+    if (isDrained && queue.length === 0) {+      // Rerender with the resources and resolve the data from the cache+      result = RecipesReconciler.render(recipeWithWrapper, plan)+      const resources = transformToPlan(result)+      emitter.emit(`done`, resources)+    }+  } -    RecipesReconciler.render(recipeWithWrapper, plan)+  const throttledRenderResources = lodash.throttle(renderResources, 30, {+    trailing: false,+  }) -    if (!queue.size) {-      return undefined-    }+  queue.on(`task_finish`, function (taskId, r, stats) {+    throttledRenderResources() -    queue.start()-    await queue.onIdle()-    return await renderResources()-  }+    const resources = transformToPlan(result)+    emitter.emit(`update`, resources)+  }) -  try {-    // Begin the "render loop" until there are no more resources being queued.-    await renderResources()+  queue.on(`drain`, () => {+    renderResources(true)+  }) -    // Rerender with the resources and resolve the data from the cache-    const result = RecipesReconciler.render(recipeWithWrapper, plan)-    return transformToPlan(result)-  } catch (e) {-    throw e+  renderResources()++  if (isStream) {+    return emitter+  } else {+    return new Promise((resolve, reject) => {

default to the old promise resolve when things are done & let people opt into the stream interface

KyleAMathews

comment created time in 2 days

Pull request review commentgatsbyjs/gatsby

feat(gatsby-recipes): live stream updates from creating resources

 import { useRecipeStep } from "./step-component" import { InputProvider } from "./input-provider" import { ResourceProvider, useResourceContext } from "./resource-provider" -const queue = new Queue({ concurrency: 5, autoStart: false })

with running recipes in parallel — we can't have global vars

KyleAMathews

comment created time in 2 days

Pull request review commentgatsbyjs/gatsby

feat(gatsby-recipes): live stream updates from creating resources

 const recipeMachine = Machine(               cb(`TICK`)             }, 10000) -            applyPlan(context, cb)-              .then(result => {+            const emitter = applyPlan(context, cb)+            emitter.on(`*`, (type, e) => {+              if (type === `update`) {+                cb({ type: `onUpdate`, data: e })

listen for updates from the renderer and send them out

KyleAMathews

comment created time in 2 days

Pull request review commentgatsbyjs/gatsby

feat(gatsby-recipes): live stream updates from creating resources

 import React, { Suspense, useContext, useState } from "react"-import Queue from "p-queue"+import Queue from "better-queue"

was having odd problems with p-queue not providing events when things finished so moved to the tried & true better-queue

KyleAMathews

comment created time in 2 days

push eventgatsbyjs/gatsby

Owlypixel

commit sha 3b239a5df00e13e0a5cde306fb0ca2d27db861eb

Fix links to gatsby-theme-blog and gatsby-theme-blog-core (#26279)

view details

Owlypixel

commit sha e2030ae10a8eb1a0e5914e8bb9ff51668b52537a

chore(docs): Fix broken link to the gatsby-theme-blog (#26277)

view details

Kyle Mathews

commit sha 1e74b7c8197399fd270fc91e4a8aa7f75a569a66

fix(gatsby-recipes): fix for when recipes have multiple NPMPackageJSON resources (#26281) * fix(gatsby-recipes): restrict changes to package.json to one at a time * Add message for npmpackagejson + make install output denser * update snapshots

view details

Kyle Mathews

commit sha 82e5a75c47188b15df5e004caaaabe304684f630

chore(release): Publish - gatsby-admin@0.1.124 - gatsby-cli@2.12.79 - gatsby-recipes@0.2.9 - gatsby@2.24.35

view details

Kyle Mathews

commit sha 97c03e9570f52be7bf1255ab97ac389b0d526822

Merge branch 'master' into live-updates

view details

push time in 2 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 82e5a75c47188b15df5e004caaaabe304684f630

chore(release): Publish - gatsby-admin@0.1.124 - gatsby-cli@2.12.79 - gatsby-recipes@0.2.9 - gatsby@2.24.35

view details

push time in 2 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 80ee6c6d336d61a28b778ddd75b9f336f5205d83

don't exit rendering until queue has drained

view details

push time in 2 days

delete branch gatsbyjs/gatsby

delete branch : batch-package.json

delete time in 2 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 1e74b7c8197399fd270fc91e4a8aa7f75a569a66

fix(gatsby-recipes): fix for when recipes have multiple NPMPackageJSON resources (#26281) * fix(gatsby-recipes): restrict changes to package.json to one at a time * Add message for npmpackagejson + make install output denser * update snapshots

view details

push time in 2 days

PR merged gatsbyjs/gatsby

fix(gatsby-recipes): fix for when recipes have multiple NPMPackageJSON resources topic: recipes

Also threw in improvement to install output

Screen Shot 2020-08-06 at 3 07 12 PM

+86 -28

6 comments

4 changed files

KyleAMathews

pr closed time in 2 days

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): fix for when recipes have multiple NPMPackageJSON resources

 const handleResource = (resourceName, context, props) => {         resolve(cachedValue)         updateResource(cachedValue)       } else {+        // if (fn == `create`) {

yeah... probably — not too worried about having really clean code still 🤷

KyleAMathews

comment created time in 2 days

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): fix for when recipes have multiple NPMPackageJSON resources

 const getDiff = require(`../utils/get-diff`)  const resourceSchema = require(`../resource-schema`) +class Deferred {

possibly! I copied it off stackoverflow haha — we'll probably migrate this whole bit of code that handles writing to a single shared resource (in this case to package.json) to its own library.

KyleAMathews

comment created time in 2 days

pull request commentgatsbyjs/gatsby

feat(gatsby-recipes): live stream updates from creating resources

Yeah will update the tests in a bit

KyleAMathews

comment created time in 2 days

create barnchgatsbyjs/gatsby

branch : live-updates

created branch time in 3 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha d7f8a64af251e132cfc721241c18f13a5e253fb9

chore(release): Publish - gatsby-admin@0.1.123 - gatsby-cli@2.12.78 - gatsby-plugin-netlify@2.3.12 - gatsby-recipes@0.2.8 - gatsby@2.24.34

view details

push time in 3 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 58aae29a7e1bb5f7e1b8839a6b485c36421a54e2

update snapshots

view details

push time in 3 days

PR opened gatsbyjs/gatsby

fix(gatsby-recipes): fix for when recipes have muiltiple NPMPackageJSON resources

Also throw in improvement to install output

+73 -8

0 comment

3 changed files

pr created time in 3 days

create barnchgatsbyjs/gatsby

branch : batch-package.json

created branch time in 3 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 7877b50f17abc4bef0c723b4fe89f1bcbe62f546

fix linting

view details

push time in 4 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 21a71a6521ddfd2c8584e0e43d56c5dcbff939bc

chore(release): Publish - gatsby-admin@0.1.120 - gatsby-cli@2.12.76 - gatsby-recipes@0.2.6 - gatsby@2.24.31

view details

push time in 4 days

PR opened gatsbyjs/gatsby

fix(gatsby-recipes): rename/remove internal fields

Some fields are leftover from earlier prototypes & some don't make sense conceptually anymore with design changes

+28 -68

0 comment

9 changed files

pr created time in 4 days

create barnchgatsbyjs/gatsby

branch : cleanup-datatypes

created branch time in 4 days

PR opened gatsbyjs/gatsby

fix(gatsby-recipes): also show general errors
+16 -1

0 comment

1 changed file

pr created time in 4 days

create barnchgatsbyjs/gatsby

branch : reci-general-errors

created branch time in 4 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 1c72df3dffbafb38de4f214c9eb69aa15a2c61fd

chore(release): Publish - gatsby-admin@0.1.119 - gatsby-cli@2.12.75 - gatsby-recipes@0.2.5 - gatsby-remark-code-repls@3.2.11 - gatsby-remark-embed-snippet@4.3.14 - gatsby@2.24.30

view details

push time in 4 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 9084d995ecd28ac93fdf72e3316020db4a178bb8

update snapshots

view details

push time in 4 days

PR opened gatsbyjs/gatsby

fix(gatsby-recipes): Handle string values in NPMPackageJSON + more robust showing of validation errors on install

Fixes for bugs reported by @graysonhicks

+27 -13

0 comment

2 changed files

pr created time in 4 days

create barnchgatsbyjs/gatsby

branch : small-fixes

created branch time in 4 days

issue commentgatsbyjs/gatsby

How to avoid using pageContext in Gatsby-Node to pass big changes of data to pages?

While it is possible to query all these things to, it becomes incredibly error prone and cumbersome to create links in the templates, because the link structure also varies from content type and I end up using complicated mechanisms and longer than necessary queries to assemble links.

Would it be possible to put the logic into a function with lots of unit tests? Then use that to create the links for pages in gatsby-node as well as in the browser?

oneextra

comment created time in 4 days

issue commentgatsbyjs/gatsby

Gatsby Recipes Umbrella Issue

PR with fixes to the above issues is out — please update and try it out! @graysonhicks — you can run your recipe now & there's some nice clear validation messages now for some of your resource — try out the --develop mode for hot-reloading!

KyleAMathews

comment created time in 4 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha a4880def2ea4153061abc63ff21782368525fd6c

chore(release): Publish - gatsby-admin@0.1.118 - gatsby-cli@2.12.74 - gatsby-recipes@0.2.4 - gatsby@2.24.29

view details

push time in 4 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 77f64dbcf6d26d30517c44cfae11848790363d57

doc change to trigger new test run

view details

push time in 4 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha aadb1f440e92e8733b950168183f487dead796c6

Update snapshots

view details

push time in 4 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 5613719827e9778cab92b645944fc677d2510e7d

Address feedback

view details

push time in 4 days

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): fix prop validation & creation of cache keys during installs

 DEBUG=true node --inspect-brk ./node_modules/.bin/gatsby recipes ./test.mdx  Then, open up Chrome and click the node icon in dev tools.

we've moved away from recipe-server.log as it's a lot easier to just run the API process in its own terminal window + it's tricky to make sure everything is logged when running things in the background.

KyleAMathews

comment created time in 4 days

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): fix prop validation & creation of cache keys during installs

 const recipeMachine = Machine(           },         },         on: {-          CONTINUE: `applyingPlan`,+          CONTINUE: [+            {+              target: `applyingPlan`,+              cond: `hasNoErrors`,+            },+            {+              target: `doneError`,+              cond: `hasErrors`,+            },+          ],

👍 good idea

KyleAMathews

comment created time in 4 days

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): fix prop validation & creation of cache keys during installs

 const destroy = async ({ root }, { id }) => {  const schema = {   name: Joi.string(),-  value: Joi.string(),+  value: Joi.object(),

it is but we're in alpha so breaking changes are expected. Also we hadn't documented this resource yet for this exact reason as we knew we wanted it to work this way.

KyleAMathews

comment created time in 4 days

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): fix prop validation & creation of cache keys during installs

 module.exports.plan = async ({ root }, { id, name, value }) => {   const key = id || name

oh right — we just need to use value now

KyleAMathews

comment created time in 4 days

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): fix prop validation & creation of cache keys during installs

 export default async ({         )       } -      const Error = ({ state }) => {-        if (state && state.context && state.context.error) {-          return <Text red>{JSON.stringify(state.context.error, null, 2)}</Text>-        }--        return null-      }-       if (state?.value === `doneError`) {-        return <Error width="100%" state={state} />+        process.nextTick(() => process.exit())+        return (+          <ResourceProvider+            value={+              state.context.plan?.filter(p => p.resourceName !== `Input`) || []+            }+          >+            <Text bold>+              Your recipe didn't validate. Please fix the following errors:+            </Text>+            <Text>{`\n`}</Text>+            {state.context.plan+              .filter(p => p.error)+              .map((p, i) => (+                <ResourceComponent key={i} {...p} />

this renders and exits so it's pretty safe :-D — it's just to keep React quiet.

KyleAMathews

comment created time in 4 days

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): fix prop validation & creation of cache keys during installs

 export default async ({         )       } -      const Error = ({ state }) => {-        if (state && state.context && state.context.error) {-          return <Text red>{JSON.stringify(state.context.error, null, 2)}</Text>-        }--        return null-      }-       if (state?.value === `doneError`) {-        return <Error width="100%" state={state} />+        process.nextTick(() => process.exit())+        return (+          <ResourceProvider+            value={+              state.context.plan?.filter(p => p.resourceName !== `Input`) || []+            }+          >+            <Text bold>+              Your recipe didn't validate. Please fix the following errors:

👍 to /s/your/this

KyleAMathews

comment created time in 4 days

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): fix prop validation & creation of cache keys during installs

 export default async ({         )       } -      const Error = ({ state }) => {-        if (state && state.context && state.context.error) {-          return <Text red>{JSON.stringify(state.context.error, null, 2)}</Text>-        }--        return null-      }-       if (state?.value === `doneError`) {-        return <Error width="100%" state={state} />+        process.nextTick(() => process.exit())+        return (+          <ResourceProvider+            value={+              state.context.plan?.filter(p => p.resourceName !== `Input`) || []

adding it as a comment

KyleAMathews

comment created time in 4 days

pull request commentgatsbyjs/gatsby

fix(gatsby): Move static queries to page data dir

we could change the directory name to something more nonsensical to further avoid chances of classes e.g. sq/d/*

sidharthachatterjee

comment created time in 4 days

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): fix prop validation & creation of cache keys during installs

 export default async ({         )       } -      const Error = ({ state }) => {-        if (state && state.context && state.context.error) {-          return <Text red>{JSON.stringify(state.context.error, null, 2)}</Text>-        }--        return null-      }-       if (state?.value === `doneError`) {-        return <Error width="100%" state={state} />+        process.nextTick(() => process.exit())+        return (+          <ResourceProvider+            value={+              state.context.plan?.filter(p => p.resourceName !== `Input`) || []

inputs are components too like resources which is why we exclude them. The input from the inputs (haha) are ignored unless they're passed as props into a resource component in which case they're validated like normal.

KyleAMathews

comment created time in 4 days

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): fix prop validation & creation of cache keys during installs

 export default async ({         )       } -      const Error = ({ state }) => {-        if (state && state.context && state.context.error) {-          return <Text red>{JSON.stringify(state.context.error, null, 2)}</Text>-        }--        return null-      }-       if (state?.value === `doneError`) {-        return <Error width="100%" state={state} />+        process.nextTick(() => process.exit())

Ink v2 wouldn't exit cleanly under some conditions. Perhaps v3 is better.

KyleAMathews

comment created time in 4 days

issue commentgatsbyjs/gatsby

Gatsby Recipes Umbrella Issue

Clever!

KyleAMathews

comment created time in 5 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha b2cd3e075ee7b57579addc50b50210c62cd33897

Show resources with errors when trying to install

view details

push time in 5 days

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): fix prop validation & creation of cache keys during installs

 exports.schema = schema exports.validate = validate  module.exports.plan = async ({ root }, { id, name, value }) => {+  // let parsedValue = value

nope! Thanks!

KyleAMathews

comment created time in 5 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 6ec8078477a9c6d455b6c47d3e34a7cc681ddfc0

Fix recipe validation error by not allowing recipes to be applied that have any errors

view details

push time in 5 days

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): fix prop validation & creation of cache keys during installs

 const render = async (recipe, cb, inputs = {}, isApply) => {      RecipesReconciler.render(recipeWithWrapper, plan) -    if (errors.length) {

removed generic error handling for what we actually do have support for right now namely validation.

KyleAMathews

comment created time in 5 days

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): fix prop validation & creation of cache keys during installs

 const validateResource = (resourceName, context, props) => {   return error } -const handleResource = (-  resourceName,-  context,-  props,-  allResources,-  setResources-) => {-  const error = validateResource(resourceName, context, props)-  if (error) {-    errors.push(error)-    return null-  }-+const handleResource = (resourceName, context, props) => {+  // Initialize   const { mode } = context -  let key+  const trueKey = props._key ? props._key : context._uuid++  let cacheKey   // Only run apply once per resource   if (mode === `apply`) {-    key = mode + ` ` + resourceName + ` ` + props._key

some resources have a key & others have auto-generated UUIDs — we weren't reflecting that which meant that all subsequent resources hit the same cache key as the first of its type.

KyleAMathews

comment created time in 5 days

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): fix prop validation & creation of cache keys during installs

 const handleResource = (       ...result,     } -    if (-      props._key &&-      !lodash.isEqual(newResource, resourceMap.get(props._key))-    ) {-      resourceMap.set(props._key, newResource)-      setResources([...resourceMap.values()])+    if (!lodash.isEqual(newResource, resourceMap.get(trueKey))) {+      resourceMap.set(trueKey, newResource)+      // TODO Do we need this? It's causing infinite loops+      // setResources([...resourceMap.values()])

I think this is for nested resources... maybe @johno remember? Anyways, we'll figure it out again when we return to that.

KyleAMathews

comment created time in 5 days

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): fix prop validation & creation of cache keys during installs

 const validateResource = (resourceName, context, props) => {   return error } -const handleResource = (-  resourceName,-  context,-  props,-  allResources,

removed a lot of extra props

KyleAMathews

comment created time in 5 days

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): fix prop validation & creation of cache keys during installs

 exports.schema = schema exports.validate = validate  module.exports.plan = async ({ root }, { id, name, value }) => {+  // let parsedValue = value   const parsedValue = typeof value === `string` ? JSON.parse(value) : value   const key = id || name   const currentState = readPackageJson(root)   const newState = { ...currentState, [key]: parsedValue }+  const diff = await getDiff(currentState, newState)    return {     id: key,     name,     currentState: JSON.stringify(currentState, null, 2),     newState: JSON.stringify(newState, null, 2),     describe: `Add ${key} to package.json`,-    diff: ``, // TODO: Make diff

snuck this in while at it

KyleAMathews

comment created time in 5 days

Pull request review commentgatsbyjs/gatsby

fix(gatsby-recipes): fix prop validation & creation of cache keys during installs

 const { // even if another instance might already be running. This is necessary to ensure the gatsby // develop command does not _not_ run the server if the user is running gatsby recipes at the same time. export default async (programPath, forceStart) => {+  // If this env variable is set, we're in dev mode & assume the recipes API was already started+  // manually.+  if (process.env.RECIPES_DEV_MODE) {

much better way of getting a dev version of the recipes API

KyleAMathews

comment created time in 5 days

issue commentgatsbyjs/gatsby

Gatsby Recipes Umbrella Issue

PR up with some fixes https://github.com/gatsbyjs/gatsby/pull/26235

KyleAMathews

comment created time in 5 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 10ff7ca3947b556dc372c5ef82489fc8f73914a5

And again

view details

push time in 5 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha 928b78228b7d80b8c4fb9fcb744899b36d4d6a55

Fix lint error

view details

push time in 5 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha faeefb1a69204aa0dcede9af64c2f0328fce5a05

update snapshots

view details

push time in 5 days

PR opened gatsbyjs/gatsby

fix(gatsby-recipes): fix prop validation & creation of cache keys during installs

Couple of bugs from the alpha.2 release

+54 -103

0 comment

6 changed files

pr created time in 5 days

push eventgatsbyjs/gatsby

Kyle Mathews

commit sha c630c6c24e2d76d1c3d59e45b0190022f6f2d269

Fix creation of the cache key which was messing up installs

view details

push time in 5 days

create barnchgatsbyjs/gatsby

branch : fix-recipes

created branch time in 5 days

issue commentgatsbyjs/gatsby

Gatsby Recipes Umbrella Issue

@graysonhicks thanks for the bug report — hadn't seen that but can reproduce it locally — @johno or I will get it fixed a bit later

KyleAMathews

comment created time in 5 days

created repositoryKyleAMathews/test-gatsby-markdown-blog

Gatsby starter for creating a blog

created time in 6 days

push eventKyleAMathews/gatsby-sanity-demo

Kyle Mathews

commit sha 486f2f838eaddae0045b15ff8337e9c9088992fd

update source plugin

view details

push time in 6 days

push eventKyleAMathews/gatsby-sanity-demo

Kyle Mathews

commit sha a54ae5e2644466b529935e7053ff7e1aa95cea0f

updates

view details

push time in 6 days

push eventKyleAMathews/gatsby-sanity-demo

Kyle Mathews

commit sha a38ca9846bbcfffd06a4b1e46593b389c08f4067

Update version

view details

push time in 6 days

push eventKyleAMathews/sanity-kitchen-sink

Kyle Mathews

commit sha d0ff0b85776aa97b6fd2e6451bb4c3994c9bc9cc

updated packages

view details

push time in 6 days

push eventKyleAMathews/sanity-kitchen-sink

Sanity.io

commit sha 08b03a66d6178d96d9847d856fca15132c6c5e62

Initial commit

view details

push time in 6 days

delete branch KyleAMathews/sanity-kitchen-sink

delete branch : master

delete time in 6 days

create barnchKyleAMathews/sanity-kitchen-sink

branch : production

created branch time in 6 days

create barnchKyleAMathews/sanity-kitchen-sink

branch : master

created branch time in 6 days

created repositoryKyleAMathews/sanity-kitchen-sink

Kitchen Sink

created time in 6 days

push eventKyleAMathews/gatsby-sanity-demo

Kyle Mathews

commit sha 84c5411fd1ff3b09038a64540e2095153c68843e

looks like cloud is hard-coded to npm for lerna

view details

push time in 6 days

push eventKyleAMathews/gatsby-sanity-demo

Kyle Mathews

commit sha 731f870823cffeef0aafc4b37c496e972cd8499b

remove lock file

view details

push time in 6 days

push eventKyleAMathews/gatsby-sanity-demo

Kyle Mathews

commit sha 9f31bc55aee580930f6a2aa2ed83b0a4af023bb4

Update dependencies

view details

push time in 6 days

more