Last active
August 21, 2024 12:42
-
-
Save lunelson/9dfb9a6c4cac7d60175bb5c8ff1882e3 to your computer and use it in GitHub Desktop.
Revisions
-
lunelson revised this gist
Nov 19, 2020 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,9 @@ the most viable solutions are here - [pristas-peter/gatsby-plugin-graphql-component: Query React Components in Gatsby GraphQL queries](https://github.com/pristas-peter/gatsby-plugin-graphql-component) ## loadable-components strong general solution. try this one first. https://loadable-components.com/ https://github.com/hector-del-rio/gatsby-plugin-loadable-components-ssr -
lunelson revised this gist
Nov 19, 2020 . 1 changed file with 45 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,45 @@ # gatsby dynamic modules, solutions the most viable solutions are here - [Better Performance using Dynamic Code Splitting in Gatsby with loadable-components - DEV](https://dev.to/itmayziii/better-performance-using-dynamic-code-splitting-in-gatsby-with-loadable-components-6am) - [An SEO approach to async components with loadable-components - LogRocket Blog](https://blog.logrocket.com/seo-approach-async-loadable-components/) - [Getting Started - Loadable Components](https://loadable-components.com/docs/getting-started/) - [loadable-components/main.js at master · gregberge/loadable-components](https://github.com/gregberge/loadable-components/blob/master/examples/server-side-rendering-async-node/src/server/main.js) - [hector-del-rio/gatsby-plugin-loadable-components-ssr: Gatsby plugin for using @loadable/component with Gatsby's SSR](https://github.com/hector-del-rio/gatsby-plugin-loadable-components-ssr) - [pristas-peter/gatsby-plugin-graphql-component: Query React Components in Gatsby GraphQL queries](https://github.com/pristas-peter/gatsby-plugin-graphql-component) ## loadable-components? https://loadable-components.com/ https://github.com/hector-del-rio/gatsby-plugin-loadable-components-ssr ## gatsby-plugin-graphql-component https://github.com/pristas-peter/gatsby-plugin-graphql-component allows you to register components within graphQL schema, so that you can query them out in pages and use them ## Gatsby Page Modules Draft PR: https://github.com/gatsbyjs/gatsby/pull/24903 demo: https://github.com/pieh/query-webpack-modules-demo-site/ published: `gatsby@query-webpack-modules` - `context.pageModel.setModule` is a function enabled in graphQL resolvers, so it would be accessed in `gatsby-node.js` inside the `creatSchemaCustomization` or `createResolvers` hooks ```js context.pageModel.setModule({ source: 'abs/path/to/module', type: "default" | "named" | "namespace", importName: 'nameOfImport' // only if type == 'name' }); // returns a string identifier ``` - `getModule` is a function which can be imported from gatsby, and can retrieve the module by name ```js import { getModule } from 'gatsby'; const Component = getModule('uid-returned-from-setModule'); ``` - needs `process.env.GATSBY_EXPERIMENTAL_QUERY_MODULES = 1` set, in `gatsby-config.js` -
lunelson created this gist
Nov 19, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@