Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(gatsby-plugin-functions): Add the ability to run functions locally and on Gatsby Cloud #30192
feat(gatsby-plugin-functions): Add the ability to run functions locally and on Gatsby Cloud #30192
Changes from 26 commits
098a209
7576e2a
df0496f
5d0c3e8
9febad5
0597a5f
2536188
29159df
eec2a09
6470ee4
9635aa1
4a59a47
85d7cfa
ef07abd
72877bc
daf3b04
32bd3d6
a2ae24e
c1a2a05
3d9ecbc
6067919
2aacbcc
1587dc2
f0ab110
b5324f9
21e1841
6ce15fa
b2c4aa8
bd0acc5
4cfde03
cc98e76
17730bd
80a9882
56176d3
eace7e8
5c1f96e
6b8d414
b325d12
88d76a1
311c9ec
d554093
63bc54c
f08d0ee
5d6d072
7fbac4a
4af22f9
324bd99
92e05c9
2163f08
aad744d
c5c61ec
aaf53f9
d2d7af0
02fcfbe
4bec919
ac9e55d
a26ac14
5cc3661
ae8f46f
0336739
7282d1f
6caff93
4b5aa4e
10226e4
1ee2d24
4a9fffd
3cba097
9c164f7
771fb62
b2f2af2
73dceb4
10cd117
42de7d5
8405b31
af36e09
2b7c7cf
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
This file was deleted.
This file was deleted.
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.
We could support
program.extensions
but we would need to add a loader as well for each new one (like Coffeescript for example) and we don't inherit the Gatsby web pack config (to reduce complexity) so we would need to add a new lifecycle for thisWe can consider doing this later
Let's add a comment in code for this
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.
We currently support deep paths like
/world/bob.js
but we don't know if that would work on Gatsby Cloud. Let's confirm that.Also, since this will be the source of truth for functions in a project, shall we put this in state and add a getter action for it? This will enable
gatsby-plugin-gatsby-cloud
To do this, we need to add
gatsby-plugin-functions
as an internal plugin under an experiment?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.
Remember to ensure that Gatsby Cloud knows how to turn on this experiment and also that this experiment will only be available from a certain version of Gatsby onwards
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.
We should deprecate the plugin on npm and print a deprecation message (like what we did for
gatsby-image
)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.
Add this back in and add in coordination for hot reload and check
NODE_ENV
insteadThere 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 is expensive because webpack is run once for each function. Instead let's use a single one with multiple entries. Remember to disable split chunking.
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.
Look at how we sanitize Webpack errors in core and port that over here so that warnings look sane
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.
When we add hot reload, we should switch this over
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.
Promise.race
with a timeout controlled by an env var that can be set and defaults to 30 seconds?Should warn if race fails