Splits the functionality in gatsby/createPages.js into three different exported functions:
createRedirects
createGhostPages
createMarkdownPages
Return those three functions in form of Promise.all() in our gatsby-node.js file instead of simply requiring the whole file.
This way we are able to see what's meant to happen within our createPages without the need to open the required files, as the methods are explaining the functionality themselves.
🚚 Make onCreateNode API methods more readable
Name the fn in onCreateNode.js so it's more clear what it does → createMarkdownNodeFields
Return these functions in form of an object in our gatsby-node.js file instead of simply requiring the whole file.
🚚 Destructure gatsby-browser file to show fn names
Restructure gatsby-browser.js file to return the method names that we're using for each browser API endpoint so it's more clear to understand what each method does.
Other improvements
✅ Put back protocol check for killServiceWorker, which was only commented out for testing purposes
closes #70
🚚 Make
createPages
API methods more readablePromise.all()
in ourgatsby-node.js
file instead of simply requiring the whole file.createPages
without the need to open the required files, as the methods are explaining the functionality themselves.🚚 Make
onCreateNode
API methods more readableonCreateNode.js
so it's more clear what it does →createMarkdownNodeFields
gatsby-node.js
file instead of simply requiring the whole file.🚚 Destructure gatsby-browser file to show fn names
gatsby-browser.js
file to return the method names that we're using for each browser API endpoint so it's more clear to understand what each method does.Other improvements
Promise.all()
which is ES6 native