- Notifications
You must be signed in to change notification settings - Fork18
feat: decoupled sourcing PoC#561
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
netlifybot commentedFeb 10, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview fornetlify-plugin-gatsby-demo ready!
To edit notification comments on pull requests, go to yourNetlify site settings. |
plugin/package.json Outdated
| "prepare":"npm run build" | ||
| }, | ||
| "dependencies": { | ||
| "@gatsby-cloud-pkg/merlin-synchronizer":"^0.3.6", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Adding it as a dep of the pluginshould make it resolvable to builds, but we can do tests with auto-install using feature flags later
| if( | ||
| !process.env.GATSBY_CLOUD_DATALAYER|| | ||
| !process.env.GATSBY_SITE_ID|| | ||
| !process.env.SITE_AUTH_JWT | ||
| ){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
These currently need to be manually set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
instead of SITE_AUTH_JWT, can we make itRESOURCE_AUTH_JWT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
and instead ofGATSBY_SITE_ID lets doCONTENT_CLOUD_ID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
SITE_AUTH_JWT is formerlin-synchronizer, so we'd need to change that module to allow either
| * This file was copied from Gatsby core and modified and will be copied back into node_modules/gatsby when Netlify does a cold-cache build. | ||
| * See 'helpers/files.ts' | ||
| */ | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This injected file is copied from the Gatsby repo with a few small changes to work on Netlify
| returnoriginalSourceNodesApiRunner.sourceNodesApiRunner(args) | ||
| } | ||
| const{ synchronize}=require(`@gatsby-cloud-pkg/merlin-synchronizer`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Wemay need to replace this with a full resolved path to the dependency if resolving from an auto-installed plugin fails
Uh oh!
There was an error while loading.Please reload this page.
| encoding:`string`, | ||
| }).init() | ||
| constsiteId=process.env.GATSBY_SITE_ID |
abhiaiyer91Feb 10, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
this will beCONTENT_CLOUD_ID
Uh oh!
There was an error while loading.Please reload this page.
Summary
PoC for experimental decoupled sourcing support. Test this by installing
@netlify/plugin-gatsby@merlinand then setting the env varsGATSBY_CLOUD_DATALAYER,CONTENT_CLOUD_IDandRESOURCE_AUTH_JWTTest plan
Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal
Standard checks:
🧪 Once merged, make sure to update the version if needed and that it was
published correctly.