Skip to content

Commit

Permalink
Merge branch 'canary' into feat/configurable-dynamic-guards
Browse files Browse the repository at this point in the history
  • Loading branch information
feugy committed Aug 30, 2022
2 parents 56aa1db + 5b3e20a commit 522af46
Show file tree
Hide file tree
Showing 182 changed files with 12,870 additions and 5,164 deletions.
2 changes: 1 addition & 1 deletion docs/advanced-features/debugging.md
Expand Up @@ -90,7 +90,7 @@ Debugging server-side code here works much like debugging client-side code with

### Debugging on Windows

Windows users may run into an issue when using `NODE_OPTIONS='--inspect'` as that syntax is not supported on Windows platforms. To get around this, install the [`cross-env`](https://www.npmjs.com/package/cross-env) package as a development dependency (`--dev` with NPM or `-D` for Yarn) and replace the `dev` script with the following.
Windows users may run into an issue when using `NODE_OPTIONS='--inspect'` as that syntax is not supported on Windows platforms. To get around this, install the [`cross-env`](https://www.npmjs.com/package/cross-env) package as a development dependency (`-D` with `npm` and `yarn`) and replace the `dev` script with the following.

```json
"dev": "cross-env NODE_OPTIONS='--inspect' next dev",
Expand Down
2 changes: 1 addition & 1 deletion examples/convex/pages/_app.tsx
Expand Up @@ -8,7 +8,7 @@ const convex = new ConvexReactClient(convexConfig.origin)
function MyApp({ Component, pageProps }: AppProps) {
return (
<ConvexProvider client={convex}>
<Component {...pageProps} />;
<Component {...pageProps} />
</ConvexProvider>
)
}
Expand Down
Expand Up @@ -7,6 +7,7 @@ import { format } from '../../utils/utils'
styleUrl: 'my-component.css',
shadow: true,
})
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export class MyComponent {
/**
* The first name
Expand Down
File renamed without changes.
@@ -1,8 +1,9 @@
import ThirdPartyEmailPasswordNode from 'supertokens-node/recipe/thirdpartyemailpassword'
import SessionNode from 'supertokens-node/recipe/session'
import { appInfo } from './appInfo'
import { AuthConfig } from '../interfaces'

export let backendConfig = () => {
export let backendConfig = (): AuthConfig => {
return {
framework: 'express',
supertokens: {
Expand Down
16 changes: 16 additions & 0 deletions examples/with-supertokens/interfaces.d.ts
@@ -0,0 +1,16 @@
import { TypeFramework } from 'supertokens-node/lib/build/framework/types'

export interface AuthConfig {
framework: TypeFramework
supertokens: {
connectionURI: string
}
appInfo: {
appName: string
websiteDomain: string
apiDomain: string
apiBasePath: string
}
recipeList: any
isInServerlessEnv: boolean
}
13 changes: 9 additions & 4 deletions examples/with-supertokens/package.json
Expand Up @@ -7,9 +7,14 @@
},
"dependencies": {
"next": "latest",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"supertokens-auth-react": "^0.24.0",
"supertokens-node": "^11.0.0"
"react": "^18.2.0",
"react-dom": "^18.2.0",
"supertokens-auth-react": "^0.24.7",
"supertokens-node": "^11.2.0"
},
"devDependencies": {
"@types/react": "18.0.17",
"@types/node": "18.7.13",
"typescript": "^4.8.2"
}
}
Expand Up @@ -10,7 +10,7 @@ if (typeof window !== 'undefined') {
SuperTokensReact.init(SuperTokensConfig.frontendConfig())
}

function MyApp({ Component, pageProps }) {
function MyApp({ Component, pageProps }): JSX.Element {
useEffect(() => {
async function doRefresh() {
if (pageProps.fromSupertokens === 'needs-refresh') {
Expand Down
File renamed without changes.
Expand Up @@ -10,7 +10,7 @@ const SuperTokensComponentNoSSR = dynamic(
{ ssr: false }
)

export default function Auth() {
export default function Auth(): JSX.Element {
useEffect(() => {
if (SuperTokens.canHandleRoute() === false) {
redirectToAuth()
Expand Down
Expand Up @@ -30,14 +30,6 @@ export async function getServerSideProps(context) {
}
}

export default function Home(props) {
return (
<ThirdPartyEmailPasswordAuth>
<ProtectedPage userId={props.userId} />
</ThirdPartyEmailPasswordAuth>
)
}

function ProtectedPage({ userId }) {
const session = useSessionContext()

Expand Down Expand Up @@ -178,3 +170,11 @@ function ProtectedPage({ userId }) {
</div>
)
}

export default function Home(props) {
return (
<ThirdPartyEmailPasswordAuth>
<ProtectedPage userId={props.userId} />
</ThirdPartyEmailPasswordAuth>
)
}
20 changes: 20 additions & 0 deletions examples/with-supertokens/tsconfig.json
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "interfaces.d.ts"],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion lerna.json
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "12.2.6-canary.5"
"version": "12.2.6-canary.6"
}
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -177,8 +177,8 @@
"react-17": "npm:react@17.0.2",
"react-dom": "18.2.0",
"react-dom-17": "npm:react-dom@17.0.2",
"react-dom-exp": "npm:react-dom@0.0.0-experimental-6ef466c68-20220816",
"react-exp": "npm:react@0.0.0-experimental-6ef466c68-20220816",
"react-dom-exp": "npm:react-dom@0.0.0-experimental-0de3ddf56-20220825",
"react-exp": "npm:react@0.0.0-experimental-0de3ddf56-20220825",
"react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3",
"relay-compiler": "13.0.2",
Expand All @@ -198,7 +198,7 @@
"tree-kill": "1.2.2",
"tsec": "0.2.1",
"turbo": "1.3.2-canary.1",
"typescript": "4.6.3",
"typescript": "4.8.2",
"wait-port": "0.2.2",
"webpack": "5.74.0",
"webpack-bundle-analyzer": "4.3.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/create-next-app/package.json
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "12.2.6-canary.5",
"version": "12.2.6-canary.6",
"keywords": [
"react",
"next",
Expand Down Expand Up @@ -35,7 +35,7 @@
"@types/rimraf": "3.0.0",
"@types/tar": "4.0.3",
"@types/validate-npm-package-name": "3.0.0",
"@vercel/ncc": "0.33.4",
"@vercel/ncc": "0.34.0",
"async-retry": "1.3.1",
"chalk": "2.4.2",
"commander": "2.20.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "12.2.6-canary.5",
"version": "12.2.6-canary.6",
"description": "ESLint configuration used by NextJS.",
"main": "index.js",
"license": "MIT",
Expand All @@ -9,7 +9,7 @@
"directory": "packages/eslint-config-next"
},
"dependencies": {
"@next/eslint-plugin-next": "12.2.6-canary.5",
"@next/eslint-plugin-next": "12.2.6-canary.6",
"@rushstack/eslint-patch": "^1.1.3",
"@typescript-eslint/parser": "^5.21.0",
"eslint-import-resolver-node": "^0.3.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "12.2.6-canary.5",
"version": "12.2.6-canary.6",
"description": "ESLint plugin for NextJS.",
"main": "lib/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "12.2.6-canary.5",
"version": "12.2.6-canary.6",
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "12.2.6-canary.5",
"version": "12.2.6-canary.6",
"license": "MIT",
"dependencies": {
"chalk": "4.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/next-env/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "12.2.6-canary.5",
"version": "12.2.6-canary.6",
"keywords": [
"react",
"next",
Expand Down Expand Up @@ -30,7 +30,7 @@
"prepublishOnly": "cd ../../ && turbo run build"
},
"devDependencies": {
"@vercel/ncc": "0.33.4",
"@vercel/ncc": "0.34.0",
"dotenv": "10.0.0",
"dotenv-expand": "8.0.1",
"rimraf": "3.0.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "12.2.6-canary.5",
"version": "12.2.6-canary.6",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "12.2.6-canary.5",
"version": "12.2.6-canary.6",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "12.2.6-canary.5",
"version": "12.2.6-canary.6",
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
"main": "dist/polyfill-module.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "12.2.6-canary.5",
"version": "12.2.6-canary.6",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/swc",
"version": "12.2.6-canary.5",
"version": "12.2.6-canary.6",
"private": true,
"scripts": {
"build-native": "napi build --platform -p next-swc-napi --cargo-name next_swc_napi native --features plugin",
Expand Down
2 changes: 1 addition & 1 deletion packages/next/build/analysis/get-page-static-info.ts
Expand Up @@ -29,7 +29,7 @@ export interface PageStaticInfo {
* - Modules with `export function getStaticProps | getServerSideProps`
* - Modules with `export { getStaticProps | getServerSideProps } <from ...>`
*/
function checkExports(swcAST: any) {
export function checkExports(swcAST: any): { ssr: boolean; ssg: boolean } {
if (Array.isArray(swcAST?.body)) {
try {
for (const node of swcAST.body) {
Expand Down
2 changes: 1 addition & 1 deletion packages/next/build/webpack/loaders/next-app-loader.ts
Expand Up @@ -49,7 +49,7 @@ async function createTreeCodeFromPath({
children ? `children: ${children},` : ''
}
}, {
filePath: '${resolvedLayoutPath}',
filePath: ${JSON.stringify(resolvedLayoutPath)},
${
resolvedLayoutPath
? `layout: () => require(${JSON.stringify(resolvedLayoutPath)}),`
Expand Down

0 comments on commit 522af46

Please sign in to comment.