Commit graph

1399 commits

Author SHA1 Message Date
Donny/강동윤
39283f1846
Update swc (#30685)
## 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`




- This fixes error message about unsupported cpu features.
- This applies https://github.com/swc-project/swc/pull/2597
  - This fix an infinite loop issue related to `@ericblade/quagga2`
2021-10-31 12:15:39 +00:00
Tim Neutkens
8a6307fc57
Remove isCommonJS check as it has been moved to next-swc (#30677)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-10-30 17:37:35 -05:00
Jiachi Liu
622a1a5549
Provide default fallback _document and _app for for concurrent mode (#30642)
* if _app is not provided, fallback to default _app page
* If _document is not provided, fallback to inline functional components version or use the default
* if Document gIP is provided, error

Closes #30654
2021-10-30 21:35:31 +00:00
Donny/강동윤
4ada314663
Add auto-commonjs and update swc (#30661)
Closes #30596



## 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`


 - This patch contains several patches from swc.

This includes https://github.com/swc-project/swc/pull/2581, which allows customizing the import path for regenerator.

 - This adds auto-detection of common js.

If `module.exports` is found and module config is not set, module config becomes common js.

 - As bonus, this includes some performance improvements

The logic for analyzing the input source file and parsing options as json is moved from the js thread to a background worker thread.
2021-10-30 13:31:58 +00:00
Leroy Witteveen
d8cb8c5fbc
Fixed "Expected jsx identifier" error on TypeScript generics & angle bracket type assertions in .ts files (#30619)
* Fixed "Expected jsx identifier" error on TypeScript generics & angle bracket type assertions

* Ignore error from node-notifier on M1

* Add tests

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-30 14:51:42 +02:00
Shu Ding
48874f1a44
Fix missing dev option for the middleware SSR loader (#30639)
Currently the `dev` option isn't passed to the render function inside the middleware SSR loader. This PR fixes it with a test case. 

Fixes #30547.

## 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`
2021-10-30 09:20:26 +00:00
JJ Kasper
599081acdf
Update output tracing to do separate passes (#30637)
* Update output tracing to do separate passes

* fix windows backslashes
2021-10-29 17:39:51 -05:00
Maia Teegarden
b5a89160f7
Chore/rust workflow (#30577)
* Remove prebuilt binaries from repo

* Prefer locally built binary

* Add binary packages as optionalDependencies

* Remove build-native workflow for prebuilt binaries

* Remove binaries from checkCompiled job

* Change build-native command to default to dev

* Add build-native-dev and have tests depend on it

* Update contributing

* Run ls to make inspect artifact download

* Use correct artifact download path

* Try using reusable workflows

* Resort to duplication for now

* Inspect artifact download

* Ensure native is copied for PR stats

* Copy after ref checkout and log binaries for PR stats

* fix typo

* copy right before linking/packing

* Use fs.copy

* fix test for now

Co-authored-by: jj@jjsweb.site <jj@jjsweb.site>
2021-10-29 13:56:56 -05:00
Jiachi Liu
fb100ee72b
Check react 18 flags and add more tests (#30575)
* error when react 18 experimental flags aren't setup properly
* add more tests for rsc ssr
2021-10-29 15:59:27 +00:00
Shu Ding
f6b15b5943
Add buffering for streaming until the shell is completed (#30585)
This PR adds buffering to `renderToReadableStream` with `onCompleteShell`, to ensure that we don't flush too early and `<head>` is completed when the client receives the first chunk of data.

X-ref: #30547.
2021-10-29 10:17:35 +00:00
Maia Teegarden
1e2fb0bb2b
Fix redundant styled-jsx global issue (#30584)
Fixes https://github.com/vercel/styled-jsx/issues/756

## 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`
2021-10-29 01:26:48 +00:00
JJ Kasper
18fc5488f9
Fix publish native including non-packages (#30589) 2021-10-28 19:36:30 -05:00
Jiachi Liu
5b4ad4a1c1
Simplify rsc related configs and fix test (#30546)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-10-28 19:02:55 +02:00
JJ Kasper
63024d32b4
Update publish-native to not block on error (#30565) 2021-10-28 11:26:09 -05:00
Tobias Koppers
93341345db
Update swc (#30552)
Co-authored-by: Donny/강동윤 <kdy1997.dev@gmail.com>
2021-10-28 17:07:48 +02:00
Tobias Koppers
c0dd481ea6
exclude musl from target (#30557) 2021-10-28 16:58:58 +02:00
Tobias Koppers
215fa85c8e
Revert "Update swc to fix minifier issue (#30540)" (#30551)
This reverts commit 387d6564ae.
2021-10-28 15:11:55 +02:00
Donny/강동윤
387d6564ae
Update swc to fix minifier issue (#30540)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-28 13:59:45 +02:00
Donny/강동윤
3a9f008c99
Update swc (#30509)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-28 12:25:54 +02:00
JJ Kasper
215cc58562
Update to copy necessary RSC files from dep (#30505)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-28 11:07:13 +02:00
JJ Kasper
82001f2d54
Share resolve logic for trace and externals (#30499)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-28 10:14:09 +02:00
Maia Teegarden
fe16ab0f22
Fix issue with placeholder followed by numbers (#30493)
* Fix issue with placeholder followed by numbers

* Build next-swc binaries
2021-10-27 17:07:45 -07:00
Tim Neutkens
aadc653665
Make sure externals is an array (#30466)
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2021-10-27 19:48:10 +02:00
Tobias Koppers
ddc916ce74
remove console.log (#30447) 2021-10-27 17:13:57 +02:00
Donny/강동윤
ddcfab4447
Update swc (#30426)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2021-10-27 16:55:35 +02:00
Tobias Koppers
f7048b55ec
fix external fallback for invalid packages (#30427)
fallback to alternative external version also when it fails because of base resolve mismatch#

fix resolved .mjs modules treated as external

fixes #30330
2021-10-27 13:53:44 +00:00
Donny/강동윤
979e9bd94f
Update swc (#30404)
## 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`


This includes

 - https://github.com/swc-project/swc/pull/2530
   - Strip out `declare`-d class properties properly.

 - https://github.com/swc-project/swc/pull/2538
   - Marks method properties as a scope while renaming variables.
   - Fix regression of object-rest pattern handler.
   - Improve name mangler a bit, by marking it as a scope.

 - https://github.com/swc-project/swc/pull/2551
   - Fix a bug of the property inlining pass which can break many react apps.

There is a minor regression in the minifier due to added aliasing check.


(I manually selected crates to update)
2021-10-27 08:18:21 +00:00
Donny/강동윤
a796cedf97
Disable loading of .swcrc (#30384)
We found that `.swcrc` was unintentionally loaded breaking applications as it is not tested for that yet, customization will be added at a later point in time



## 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`
2021-10-26 23:54:55 +00:00
Jiachi Liu
8e4055433e
Fix exportRuntime and react-18 concurrent tests (#30381)
* disable concurrent test cases in short term to improve them later
* remove bad alias in next.config.js
2021-10-26 23:17:55 +00:00
Jiachi Liu
8077f4213d
lint: remove unused (#30370) 2021-10-26 23:02:51 +02:00
Tobias Koppers
3d035cea3c
fix rsc on windows (#30364) 2021-10-26 22:24:28 +02:00
Tobias Koppers
95607130a0
keep sortedMiddleware intact as it's used by the runtime (#30361)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-26 22:18:08 +02:00
Jiachi Liu
c2541e2fd9
Fix flight loader parsing (#30345) 2021-10-26 20:13:51 +02:00
JJ Kasper
4c83292a84
Update SWC OS and CPU fields (#30341)
* Update SWC OS and CPU fields

* co-authored-by: CanKolay5677 <80613396+CanKolay5677@users.noreply.github.com>
2021-10-26 13:11:31 -05:00
Tim Neutkens
2fa8caa999
Clear up confusion around SWC being disabled for Babel while swcMinify is on (#30337) 2021-10-26 12:59:37 -05:00
Shu Ding
5ddee4494b
Add new target for middleware (#30299)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-10-26 18:50:56 +02:00
Javi Velasco
c497b3a5ff
Improve deprecation errors for new middleware API (#30316)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Steven <steven@ceriously.com>
2021-10-26 17:03:39 +02:00
JJ Kasper
8b85801852
Ensure null bytes in resolved path are handled (#30313)
This ensures we remove null bytes from the resolved path as it isn't valid when using `path`/`fs`. Additional tests have been added to ensure this is handled properly. 

## Bug

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

Fixes: https://github.com/vercel/next.js/issues/30298
2021-10-26 13:16:48 +00:00
Maia Teegarden
0ab8c7ada6
Track usage of swc features (#30297)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-10-26 09:37:38 +02:00
JJ Kasper
9eceb95596
Move outputFileTracing config up (#30295)
* Move outputFileTracing config up

* remove old nftTracing config

* remove old config

Co-authored-by: Steven <steven@ceriously.com>
2021-10-25 23:22:45 -05:00
Maia Teegarden
20da8079f3
Chore/publish all swc (#30289)
* Publish more swc targets

* Remove prebuilt binaries

* Use correct path for caching

* Build next-swc binaries

* Remove unused job dependency
2021-10-25 19:00:36 -07:00
JJ Kasper
73fbd698bd
Fix trace case with tsconfig/jsconfig baseUrl (#30286) 2021-10-25 18:38:30 -05:00
JJ Kasper
1a10ab8c39
Update error for failing to load SWC bindings (#30269) 2021-10-25 12:23:44 -05:00
Donny/강동윤
085df63bf9
next-swc: Support more platforms (#30254)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-10-25 17:00:48 +02:00
Tim Neutkens
467bf08a8a
Add events polyfill (#30256) 2021-10-25 15:32:01 +02:00
Tim Neutkens
bc3ab3ce94
Move swcMinify out of experimental (#29810) 2021-10-25 13:49:11 +02:00
JJ Kasper
474f1e7d93
Add initial test trace outputs (#30246) 2021-10-25 08:21:57 +02:00
Tim Neutkens
deaf1678b0
Ensure isServer is true when compiling middleware (#30242)
* Ensure isServer is true when compiling middleware

* Update packages/next/build/webpack-config.ts

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>

* Update packages/next/build/webpack-config.ts

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2021-10-24 20:05:27 -05:00
Tobias Koppers
04e1e01f18
test, fix and document all possible import types for URL imports (#30165)
resolve absolute URLs in CSS when using urlImports
remove `[path]` from static static image output path
replace file-loader with asset module, remove file-loader
2021-10-25 01:54:16 +02:00
Steven
367a420d5c
Use Log.warn() instead of console.warn() in next-server (#30240)
* Use Log.warn() instead of console.warn() in next-server

* Update test and update build warn as well

Co-authored-by: jj@jjsweb.site <jj@jjsweb.site>
2021-10-24 17:27:00 -05:00