Commit graph

2332 commits

Author SHA1 Message Date
11koukou
d4b29db8c7
Fix lazyRoot functionality for next/image (#33933)
Fixed lazyRoot functionality (#33290). Changed the unique id for Intersection Observers discrimination since previously they were only identified by the different rootMargins, now each being identified by the rootMargin and the root element as well
Added more Images to the test with different margins and with/without lazyRoot prop. Browser correctly initially loading two of the four Images according to the props' specifications.

Co-authored-by: Steven <steven@ceriously.com>
2022-02-07 10:46:16 -05:00
Tim Neutkens
c74e4f21ff
Add support for async fn / promise in next.config.js/.mjs (#33662)
- Add support for async function / promise export in next.config.js/.mjs
- Update docs

Adds support for https://twitter.com/timneutkens/status/1486075973204422665

But also the simpler version:

```js
module.exports = async () => {
  return {
    basePath: '/docs'
  }
}
```



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Documentation added

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-02-07 08:48:35 +00:00
Wouter Raateland
b49717f8db
Allow scroll prevention on hash change (#31921)
* Allow scroll prevention on hash change

Currently, `scrollToHash` is performed on every hash change, even when this change is caused by `<Link scroll={false} {...props} />`.
This change prevents scrolling in this case and allows users to specify the desired scrolling behavior in the router's `hashChangeComplete` event.

* Add test case and apply fixes

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-02-06 18:38:55 -06:00
Adam Pietrasiak
41706d6fd3
Require component rendered as child of Link to pass event to onClick handler (#27723)
Currently, if you render `next/link` like

```ts
<Link>
  <CustomComponent />
</Link>
```

and have 

```tsx
interface Props {
  onClick?: () => void; // <— note we're not passing event as an argument
}

function CustomComponent({ onClick }: Props) {
  return <div onClick={() => onClick?.()}>Hello</div>
}
```

It'll result in error

```
link.js?f421:21 Uncaught TypeError: Cannot read property 'defaultPrevented' of undefined
```

<!--
Thanks for opening a PR! Your contribution is much appreciated.
In order to make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-02-07 00:04:37 +00:00
Klaas Landsman
b39e49eca9
Fix detection of anchor click events inside svg (#23272)
## Bug

The `nodeName` of an anchor inside an SVG equals the lowercase `a` instead of the html anchor's uppercase `A`.
This behavior can be seen in this plain js demo: https://jsfiddle.net/L2p8f4ve/28/

fixes #23252




## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [ ] Make sure the linting passes

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-02-06 20:53:03 +00:00
Yubin
6090101581
Place 'charset' element at the top of <head> (#28119) 2022-02-06 13:51:51 -06:00
Alexander Akait
65e951e412
fix: data url handling in css-loader (#34034) 2022-02-06 11:10:14 -06:00
Sanna Jammeh
e0c7794208
Add decoratorMetadata flag if enabled by tsconfig (#32914)
fixes #32913
Adds support for decorator metadata in SWC when enabled through ts/jsconfig.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-02-06 16:48:09 +00:00
Jiachi Liu
c8fd6d89eb
Detect per page runtime config for functions manifest (#33945)
## Feature

Follow up for #33770

* When page config specify runtime is "nodejs", remove runtime option in functions manifest;
* If user enable `concurrentFeatures` and filesystem api, use `runtime: "web"` for those pages;


- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
2022-02-06 01:28:42 +00:00
Hannes Bornö
8aa3620a16
Babel & next-swc: Fix exporting page config with AsExpression (#32702)
fixes #20626

No changes needed in next-swc, see comments from @kdy1 below.

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-02-05 21:15:49 +00:00
Kara
d7de7deb70
Do not warn when application/ld+json scripts are used with next/head (#34021)
In #33968, a warning was added for script tags inserted through the
next/head component. This change unintentionally included
application/ld+json scripts, which shouldn't be triggering the
warnings (as they were originally intended to catch scripts where
loading order or timing could be important). This change adds an
exception for application/ld+json scripts, so they do not log the
warning if they are included through next/head.
2022-02-05 14:45:02 -06:00
Gerald Monaco
1aeb230839
Fix suffix ordering while streaming (#34011)
* Fix suffix ordering

* Don't start reading until after resolving

* More yak shaving
2022-02-05 13:17:29 -06:00
Kara
24fe279751
Warn in dev mode when stylesheets are added using next/head (#34004)
This commit adds a development mode warning in the console
if you try to include <link rel="stylesheet"> tags in
next/head, e.g.

```
<Head>
  <link ref="stylesheet" href="..." />
</Head>
```

The warning message explains that this pattern will not
work well with Suspense/streaming and recommends using a
custom Document component instead.

## Feature

- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [x] Errors have helpful link attached, see `contributing.md`


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-02-04 22:48:30 +00:00
JJ Kasper
1821bdea0b
Update azure config (#33999)
* Update azure config

* speed up checkout

* update config

* remove checkout path

* undo checkout change
2022-02-04 13:42:22 -06:00
JJ Kasper
103d3ab4fc
Ensure external middleware rewrite is handled correctly (#33962) 2022-02-04 13:32:30 -06:00
Gerald Monaco
0b1d5e17bc
Use react-dom/server.browser in Node.js (#33950)
Instead of branching rendering based on Node.js and browser/web runtimes, we should just use the web version for now, which can run as-is on versions >=16.5.0 of Node.js, polyfilling `ReadableStream` on older versions when necessary.

There are a few potential downsides to this, as React is less able to optimize flushing and execution. We can revisit that in the future though if desired.
2022-02-04 17:52:53 +00:00
JJ Kasper
a65e3612d0
Ensure optional chaining in swc matches babel (#33995)
This ensures we always transpile optional chaining and nullish coalescing with swc the same as we do [with babel](4812e22992/packages/next/build/babel/preset.ts (L97-L98)) since it can cause issues with webpack even when the node target supports these features. 

The specific case this seems to cause issues with webpack is when a value is imported and optional chaining is used on the import value webpack is stripping the optional chaining cc @sokra 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

Fixes: https://github.com/vercel/next.js/issues/33915
2022-02-04 17:08:01 +00:00
Kara
61ea8efe42
Warn in dev mode when script tags are added with next/head (#33968)
This commit adds a development mode warning in the console
if you try to include <script> tags in next/head, e.g.

```
<Head>
  <script async src="..." />
</Head>
```

The warning message explains that this pattern will not
work well with Suspense/streaming and recommends using the
next/script component instead.

TODO in follow-up PR: add same warning for stylesheets, etc

## Feature

- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] Integration tests added
- [x] Documentation added
- [x] Errors have helpful link attached, see `contributing.md`
2022-02-04 13:06:55 +00:00
JJ Kasper
06b263021a
Update to latest version of amphtml-validator (#33967)
* Update to latest version of amphtml-validator

* update compiled

* bump compiled
2022-02-03 20:33:38 -06:00
JJ Kasper
ce9c6b79f1
Fix flakey image-optimizer test (#33957)
x-ref: https://github.com/vercel/next.js/runs/5057168022?check_suite_focus=true
x-ref: https://github.com/vercel/next.js/runs/5055917244?check_suite_focus=true
x-ref: https://github.com/vercel/next.js/runs/5043791152?check_suite_focus=true
2022-02-03 20:46:06 +00:00
stefanprobst
49afcd4871
fix: handle jsxspreadattribute in inline-script-id eslint rule (#32421)
fixes #32178

the `inline-script-id` eslint rule crashed when encountering a `JSXSpreadAttribute`. this pr fixes that, and also handles `id` being passed via the spreaded object.

## Bug

- [x] Related issues linked using `fixes #number`
- [x] ~~Integration~~ Unit tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-02-02 23:04:22 +00:00
Andrey Lunyov
831d45d73d
Add support for Relay projects without artifactDirectory (#33918)
* update plugin

* Update the test

* remove dbg

* Use pages_dir in Relay

* copy edits

* cargo test

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-02-02 16:00:02 -06:00
JJ Kasper
cdc4ee3615
Ensure browserslist extends works properly (#33890)
* Ensure browserslist extends works properly

* add comment
2022-02-02 13:23:51 -06:00
JJ Kasper
f841307fa0
Fix parsing params for i18n optional route in minimal mode (#33896)
This fixes our parsing of params with i18n for optional catch-all routes and ensures a regression test catches this case.

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

Fixes: https://github.com/vercel/next.js/issues/30631
2022-02-02 19:02:03 +00:00
JJ Kasper
7b1baceede
Ensure external beforeFiles rewrites are handled with next/link (#33888)
This ensures we properly handle external `beforeFiles` rewrites client-side so that a different result doesn't occur client-side versus on a direct visit. 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

Fixes: https://github.com/vercel/next.js/issues/32348
2022-02-02 18:31:56 +00:00
Jiachi Liu
5365f41785
Group streaming experimental apis (#33878)
Move undocumented `next/rsc` and `next/vitals` to `next/streaming`. In the future `next/streaming` can contain streaming SSR related (including react server components) APIs together.
2022-02-02 13:42:14 +00:00
Jim Fisher
965d26eba3
Bug fix: dynamic page should not be interpreted as predefined page (#33808)
Fixes: https://github.com/vercel/next.js/issues/17096
Fixes: https://github.com/vercel/next.js/issues/23824
Closes: https://github.com/vercel/next.js/pull/33765

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added in https://github.com/vercel/next.js/pull/33765
- [x] Errors have helpful link attached (N/A)

Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-02-02 02:57:04 +00:00
Tobias Koppers
a803638da2
fix problem with HMR when middleware and page reference the same node_module (#33873)
fixes https://github.com/vercel/next.js/issues/31827



## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-02-01 21:46:07 +00:00
Jiachi Liu
4786557908
Flush buffered vitals metrics on page mount (#33867)
## Bug

fixes #32631

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
2022-02-01 20:48:08 +00:00
Stoyan Delev
a7793c7a0c
fix eslint link-passhref rule (#33857) 2022-02-01 12:53:55 -06:00
JJ Kasper
3e60c232a8
Relay Support in Rust Compiler (#33702)
Reverts vercel/next.js#33699

This re-opens the support for relay in swc, although we need to narrow in the causes for the build failures in https://github.com/vercel/next.js/runs/4950448889?check_suite_focus=true

Co-authored-by: Andrey Lunyov <102968+alunyov@users.noreply.github.com>
2022-02-01 18:18:55 +00:00
Divlo
e0095faf23
fix(next/image): render valid html according to W3C (#33825)
## Bug

- [x] Fixes #33809
- [x] Related to #33218
- [x] Integration tests added: Usage of [html-validator](https://www.npmjs.com/package/html-validator) to validate the HTML.
- [x] Errors have helpful link attached, see `contributing.md` (N/A)
2022-01-31 19:13:46 -05:00
Tim Neutkens
3bac02e032
Enable jest hoist transform when using next/jest (#33731)
Fixes #32539

Implements what was shared at https://github.com/vercel/next.js/issues/32539#issuecomment-1023139083.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-01-31 16:15:15 +00:00
Jiachi Liu
5b31c18e76
Generate functions manifest (#33770)
## Feature

Reuse most of the part from manifest plugin to generate similar assets

Resolves #33667

- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
2022-01-31 15:46:04 +00:00
Steven
b9c012f49d
Fix duplicate image src causing canceled request (#33776)
In PR #26968, we added Set of loaded images that was removed in #33474 erroneously.

We still need to track loaded images since we can't rely on `img.complete`, especially if the parent uses `react-virtualized`.

Tested on https://nextjs.org/showcase
2022-01-28 23:50:36 +00:00
Tim Neutkens
f104e9105c
Fix encoding error with location and refresh headers (#33763)
Fixes the merge conflicts in #27003

Fixes #24977
Fixes #24047
Closes #27003

Co-Authored-By: Jamie <5964236+jamsinclair@users.noreply.github.com>



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-01-28 16:20:34 +00:00
JJ Kasper
6aef15dc23
Ensure non-error thrown in getStaticPaths shows correctly (#33753) 2022-01-27 16:31:54 -06:00
JJ Kasper
7ec49be7ac
Ensure all CSS files are included for experimental critical CSS (#33752)
* Ensure all CSS files are included for experimental critical CSS

* remove extra import
2022-01-27 16:22:20 -06:00
Gal Schlezinger
7b2ea48745
Allow to delete URL search params in middleware rewrites (#33725)
This allows to have a more streamlined API for rewrites.
Since middlewares are code and not static configurations, we can allow people to
delete query params and not just overwrite them.

**⚠️ Warning ⚠️** this is a breaking change in query parameter behavior with middlewares, but the API will make more sense now. Compare the following:

```diff
  import {NextResponse} from 'next/server'
  export default function middleware({ nextUrl }) {
-   nextUrl.searchParams.set('ignored-query-param', '');
+   nextUrl.searchParams.delete('ignored-query-param'); // 🎉
    return NextResponse.rewrite(nextUrl);
  }
```

Since this is breaking change, we're adding a warning every time we find a query param that is missing, and eventually--the warning will be deleted.
I don't think we need to worry about older versions of Next.js as the current behavior is misleading: merging query parameters make sense for static rewrites, but not for middlewares where you have access to all the query parameters and can manipulate them freely.

Related:
* This is the opposite of #33454
* This supersedes #33574
2022-01-27 22:06:39 +00:00
Steven
16b5bfa78e
Add stale-while-revalidate pattern to Image Optimization API (#33735)
- Resolves #27208
2022-01-27 21:33:23 +00:00
Jiachi Liu
eea3adc53d
fix rsc test suite runner (#33745) 2022-01-27 20:51:36 +01:00
Shu Ding
66af3cee55
Improve tests for streaming and server components (#33740)
Reorganizes the existing tests as they're getting longer.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-01-27 17:24:50 +00:00
Jiachi Liu
3bda6e66b6
Use swc parse for flight server and client loaders (#33713)
* Add `parse` method for next-swc
* Use shared next-swc to parse rsc components AST
* Remove the invalid case of parsing `ExportAllDecalaration` (we didn't support it well before, so I deleted. need to support later)


Co-authored-by: Donny/강동윤 <29931815+kdy1@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-01-27 15:48:09 +00:00
Balázs Orbán
7e95e30063
fix: allow certain variable names in development (#33638)
Fixes #24570

A few variable names (listed https://github.com/vercel/next.js/issues/24570#issuecomment-828721019) were causing problems when using `next dev`.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-01-27 14:22:35 +00:00
Balázs Orbán
0d642f1264
feat: make compress configurable in standalone mode (#33717)
Fixes #33696

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-01-27 02:13:10 +00:00
Keen Yee Liau
c551a329d5
fix: image optimizer hangs when invalid image is requested (#33719)
When an invalid image is requested, the 'finish' event is never triggered,
which ultimately leads to a 504 Gateway Timeout error.

This is fixed by invoking the 'callback' in `_write()`.

fix https://github.com/vercel/next.js/issues/33441



## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-01-27 01:41:57 +00:00
JJ Kasper
b5d4564cca
Revert "Relay Support in Rust Compiler" (#33699) 2022-01-26 17:26:32 +01:00
Terence Bezman
b20eb99a4d
Relay Support in Rust Compiler (#33240)
## Feature

Implements feature requested in https://github.com/vercel/next.js/issues/30805. 

A few people including myself have been looking to use Relay with Next.JS and want to use the new Rust Compiler. This is my stab at an implementation. 

### How it works?
Finds all  `graphql` tagged template experssions and replaces them with `require`s to the file generated by Relay.

### Where I need help
- I've only worked with Rust a handful of times so I would appreciate any feedback on my use of language features.
- Is there any performance overhead to many duplicate usages of `require`? I imagine there's a cache in place but I want to be sure.
- I've added some unit tests & integration tests but I might be missing some use cases. Feel free to comment some use cases I'm not thinking about.

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Documentation added
  - I haven't added any docs since this is an experimental API.

## Documentation / Examples

You're expected to be running the Relay Compiler along side Next.JS when you're developing. This is pretty standard. I wouldn't expect people to have any problem with this.

### Usage
In your `next.config.js`
```js
module.exports = {
  experimental: {
    relay: {
      language: 'typescript', // or 'javascript`
      artifactDirectory: 'path/to/you/artifact/directory' // you can leave this undefined if you did not specify one in the `relay.json`
    }
  }
}
```


Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
2022-01-26 08:23:57 +00:00
Shu Ding
99d4d6c5a4
Implement web server as the request handler for edge SSR (#33635)
(#31506 for context)

This PR implements the minimum viable web server on top of the Next.js base server, and integrates it into our middleware (edge) SSR runtime to handle all the requests.

This also addresses problems like missing dynamic routes support in our current handler.

Note that this is the initial implementation with the assumption that the web server is running under minimal mode. Also later we can refactor the `__server_context` environment to properly passing the context via the constructor or methods.
2022-01-26 06:22:11 +00:00
11koukou
7452c0bf1b
Add lazyRoot optional property to next/image component (#33290)
* Added 'rootEl' oprional property to next/Image component resembling 'root' option of the Intersection Observer API

* changed 'rootEl' to 'lazyBoundary' and its type as well

* added test, fixed initial root detection

* Update test/integration/image-component/default/test/index.test.js

Co-authored-by: Steven <steven@ceriously.com>

* prop names changed

* added 'lazyroot' prop to the documentation

* removed unused import

* Apply suggestions from code review

* Update docs with lazyRoot added in 12.0.9

Co-authored-by: Steven <steven@ceriously.com>
2022-01-25 14:54:15 +01:00