queen.raae.codes · a developer’s logbook
← The log
1 min read

Gatsby's createNodeId is deterministic

Written in 2022, 4 years ago. Tools and advice may have moved on since.

Let’s start with a definition:

In computer science, a deterministic algorithm is an algorithm that, given a particular input, will always produce the same output[…] Wikipedia

In our Gatsby Source YouTube oEmbed Plugin, I did not trust this to be true. Complicating the code by caching the connection between the YouTube Id and the generated node id as part of the How to use the Gatsby Cache to skip subsequent external API calls

But I had this inkling it would make sense for it is deterministic and made sure to check with Ward when he guested last week’s unauthorized and rum-fueled treasure hunt.

Then this week, I came over a source plugin in the wild that does not make use of createNodeId’s deterministic nature, prompting me to share this information with you and update the Gatsby Source YouTube oEmbed Plugin.

Did you know?
Do you care?

 
All the best,
Queen Raae

Join the crew!

All the shenanigans from me and my piratical family, straight to your inbox.

Search the log

↑↓ to move · Enter to open · Esc to close All entries →