sync main with release after debugging email verification #371

Merged
Irev-Dev merged 6 commits from release into main 2021-06-19 07:36:05 +02:00
10 changed files with 391 additions and 410 deletions

2
app/.gitignore vendored
View File

@@ -1 +1,3 @@
dist
web/types/graphql.d.ts
api/types/graphql.d.ts

View File

@@ -1,6 +1 @@
const { getConfig } = require('@redwoodjs/core')
const config = getConfig({ type: 'jest', target: 'node' })
config.displayName.name = 'api'
module.exports = config
module.exports = require('@redwoodjs/testing/config/jest/api')

View File

@@ -3,9 +3,9 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"@redwoodjs/api": "^0.33.0",
"@redwoodjs/api-server": "^0.33.0",
"@redwoodjs/api": "^0.34.1",
"@sentry/node": "^6.5.1",
"cloudinary": "^1.23.0"
"cloudinary": "^1.23.0",
"graphql-tag": "^2.12.4"
}
}
}

View File

@@ -2,6 +2,7 @@ import { createUserInsecure } from 'src/services/users/users.js'
import { db } from 'src/lib/db'
import { sentryWrapper } from 'src/lib/sentry'
import { enforceAlphaNumeric, generateUniqueString } from 'src/services/helpers'
import 'graphql-tag'
Irev-Dev commented 2021-06-19 03:52:10 +02:00 (Migrated from github.com)
Review

and explicitly requiring this dependency for my signup function

and explicitly requiring this dependency for my signup function
dthyresson commented 2021-06-19 06:14:03 +02:00 (Migrated from github.com)
Review

From: https://community.redwoodjs.com/t/redwood-v0-32/2118/7

Ah - you said the magic word trifecta of Netlify + Functions + Dependency and I wonder if you encountered this: https://www.netlify.com/blog/2021/04/02/modern-faster-netlify-functions/

With the latest release of our function bundler, we’re starting to use esbuild under the hood to handle some parts of this. It also includes an additional step of inlining , where your function code and its dependencies are physically merged into a single file.

The new bundler will be enabled for all projects during the week of May 17, but you can choose to opt-in right now to test the new functionality in public beta and take advantage of the performance improvements immediately.

Perhaps the way Netlify is bundling now wasn't finding that dependency?

And v.0.32 was released on May 14 so ... "week of May 17" does coincide.

Thus make graphql-tag and explicit dependency fixing the issue fits.Thus make graphql-tag and explicit dependency fixing the issue fits.

You can define a list of modules that should be copied to the generated function artifact with their source and references untouched, skipping the inlining and tree-shaking stages. This is useful for handling dependencies that can’t be inlined, such as modules with native addons.

This is done with the external_node_modules property, which you can apply to all functions, or filter some them by name using a wildcard pattern.

# In your netlify.toml
# All functions
[functions]
  external_node_modules = ["module-one", "module-two"]

# Functions with a name starting with "my-function-*"
[functions."my-function-*"]
  external_node_modules = ["module-three", "module-four"]

# A function named "my-function-1"
[functions.my-function-1]
  external_node_modules = ["module-five", "module-six"]
From: https://community.redwoodjs.com/t/redwood-v0-32/2118/7 Ah - you said the magic word trifecta of Netlify + Functions + Dependency and I wonder if you encountered this: https://www.netlify.com/blog/2021/04/02/modern-faster-netlify-functions/ > With the latest release of [our function bundler](https://github.com/netlify/zip-it-and-ship-it), we’re starting to use [esbuild](https://esbuild.github.io/) under the hood to handle some parts of this. It also includes an additional step of *inlining* , where your function code and its dependencies are physically merged into a single file. > The new bundler will be enabled for all projects during the week of May 17, but you can choose to opt-in right now to test the new functionality in public beta and take advantage of the performance improvements immediately. Perhaps the way Netlify is bundling now wasn't finding that dependency? And v.0.32 was released on May 14 so ... "week of May 17" does coincide. Thus `make graphql-tag and explicit dependency` fixing the issue fits.Thus `make graphql-tag and explicit dependency` fixing the issue fits. > You can define a list of modules that should be copied to the generated function artifact with their source and references untouched, skipping the inlining and tree-shaking stages. This is useful for handling dependencies that can’t be inlined, such as modules with native addons. > This is done with the `external_node_modules` property, which you can apply to all functions, or filter some them by name using a [wildcard pattern](https://en.wikipedia.org/wiki/Wildcard_character). ```terminal # In your netlify.toml # All functions [functions] external_node_modules = ["module-one", "module-two"] # Functions with a name starting with "my-function-*" [functions."my-function-*"] external_node_modules = ["module-three", "module-four"] # A function named "my-function-1" [functions.my-function-1] external_node_modules = ["module-five", "module-six"] ```
const unWrappedHandler = async (req, _context) => {
const body = JSON.parse(req.body)

View File

@@ -20,7 +20,7 @@ export const foreignKeyReplacement = (input) => {
}
export const enforceAlphaNumeric = (string) =>
string.replace(/([^a-zA-Z\d_:])/g, '-')
(string || '').replace(/([^a-zA-Z\d_:])/g, '-')
export const generateUniqueString = async (
seed,

View File

@@ -4,7 +4,16 @@ publish = "web/dist"
functions = "api/dist/functions"
[dev]
command = "yarn rw dev"
# To use [Netlify Dev](https://www.netlify.com/products/dev/),
# install netlify-cli from https://docs.netlify.com/cli/get-started/#installation
# and then use netlify link https://docs.netlify.com/cli/get-started/#link-and-unlink-sites
# to connect your local project to a site already on Netlify
# then run netlify dev and our app will be accessible on the port specified below
framework = "redwoodjs"
# Set targetPort to the [web] side port as defined in redwood.toml
targetPort = 8910
# Point your browser to this port to access your RedwoodJS app
port = 8888
[[redirects]]
from = "/*"

View File

@@ -8,7 +8,7 @@
},
"scripts": {},
"devDependencies": {
"@redwoodjs/core": "^0.33.0"
"@redwoodjs/core": "^0.34.1"
},
"eslintConfig": {
"extends": "@redwoodjs/eslint-config",

View File

@@ -1,6 +1 @@
const { getConfig } = require('@redwoodjs/core')
const config = getConfig({ type: 'jest', target: 'browser' })
config.displayName.name = 'web'
module.exports = config
module.exports = require('@redwoodjs/testing/config/jest/api')

View File

@@ -16,10 +16,10 @@
"@headlessui/react": "^1.0.0",
"@material-ui/core": "^4.11.0",
"@monaco-editor/react": "^4.0.11",
"@redwoodjs/auth": "^0.33.0",
"@redwoodjs/forms": "^0.33.0",
"@redwoodjs/router": "^0.33.0",
"@redwoodjs/web": "^0.33.0",
"@redwoodjs/auth": "^0.34.1",
"@redwoodjs/forms": "^0.34.1",
"@redwoodjs/router": "^0.34.1",
"@redwoodjs/web": "^0.34.1",
"@sentry/browser": "^6.5.1",
"browser-fs-access": "^0.17.2",
"cloudinary-react": "^1.6.7",
@@ -58,4 +58,4 @@
"tailwindcss": "^2.1.2",
"worker-loader": "^3.0.7"
}
}
}

File diff suppressed because it is too large Load Diff