Skip to content
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

Merged
merged 76 commits into from
Apr 16, 2021

Conversation

sidharthachatterjee
Copy link
Contributor

@sidharthachatterjee sidharthachatterjee commented Mar 11, 2021

An initial implementation of Gatsby Functions. Learn more at the RFC at #27667

Post feedback at #30735

Test this by installing gatsby@functions-next & adding FUNCTIONS: true to your flags in your gatsby-config.js.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 11, 2021
@sidharthachatterjee sidharthachatterjee removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 11, 2021
@kelvindecosta
Copy link
Contributor

Can't wait to use this!

sidharthachatterjee and others added 7 commits March 12, 2021 20:32
…30338)

* Require files from the .cache directory so user can run es/commonjs

* Panic on build if we get an error

* Add some logging via reporter

* logging to func

* Update packages/gatsby-plugin-functions/src/gatsby-node.ts

Co-authored-by: Ward Peeters <ward@coding-tech.com>

* Function name does not include extension

* Print a relative path to the functions directory

Co-authored-by: Sidhartha Chatterjee <me@sidharthachatterjee.com>
Co-authored-by: Ward Peeters <ward@coding-tech.com>
@sidharthachatterjee sidharthachatterjee marked this pull request as ready for review March 29, 2021 11:25
@KyleAMathews KyleAMathews dismissed wardpeet’s stale review April 15, 2021 23:26

on vacation & requests are resolved

Copy link
Contributor

@LekoArts LekoArts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing we should also make sure with additional tests is how resilient our code is against names with special characters. Right now we only test the thing we are used to which is some-name.js.

What about:

  • I-Am-Capitalized.js
  • some whitespace.js
  • with-äöü-umlaut.js
  • some-àè-french.js
  • use#hashtag.js
  • some-אודות.js

This also gets relevant when we'd have src/api/endpoint/[...catch].js and people would access that with those characters

@KyleAMathews
Copy link
Contributor

@LekoArts the hashtag one wouldn't work as it's a url fragment (which aren't sent to the server)

@LekoArts
Copy link
Contributor

LekoArts commented Apr 16, 2021

Gotcha. Just added it as @pieh found a weird webpack bug that occurs when people use # in their filenames 😆

@KyleAMathews
Copy link
Contributor

@pieh would find that!

Copy link
Contributor

@LekoArts LekoArts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, got nothing else to add on my part. Dunno if @ascorbic wants to add anything to the .env handling?

@ascorbic
Copy link
Contributor

No, that's fine by me.

@KyleAMathews KyleAMathews merged commit 41eef2b into master Apr 16, 2021
@KyleAMathews KyleAMathews deleted the feat/functions branch April 16, 2021 16:08
@dmccraw
Copy link
Contributor

dmccraw commented Apr 16, 2021

🎉 🎉 Thanks everyone for getting this across the finish line. Huge for our Cloud Functions work!!!

@KyleAMathews
Copy link
Contributor

🎉 indeed!

Published in gatsby@next — see you over in the discussion! #30735

@LekoArts LekoArts added the topic: DX Developer Experience (e.g. Fast Refresh, i18n, SSR, page creation, starters) label May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: DX Developer Experience (e.g. Fast Refresh, i18n, SSR, page creation, starters)
Projects
None yet
Development

Successfully merging this pull request may close these issues.