Commit graph

64 commits

Author SHA1 Message Date
Donny/강동윤
b68f78384e
chore: Update swc (#40832)
This PR update swc crates to
8a5ed1e0ba


Noticeable changes include

 - TS 4.9 support.
 - Huge performance improvement (of every api).
2022-09-23 14:09:41 -07:00
Donny/강동윤
57be012e06
chore: Update swc (#40520)
This updates SWC crates to
69bf533571

---

 - Closes https://github.com/vercel/next.js/issues/40535

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-09-15 14:22:11 +02:00
Donny/강동윤
53ce3bf248
chore: Update swc (#40292)
This PR update swc crates to
4c078b0ac3

This PR applies
 - patches for the performance of minifier
 - https://github.com/swc-project/swc/pull/5796
   - Closes https://github.com/vercel/next.js/issues/40399
2022-09-12 09:36:44 -07:00
Donny/강동윤
6356095481
chore: Update swc (#39965)
This PR updates SWC crates to f2a0eef4f1

---


 - Closes #17056

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-09-04 12:13:22 +02:00
Donny/강동윤
ab152918ad
feat(next-swc): Update swc (#39499)
This PR applies

 - https://github.com/swc-project/swc/pull/5487
   - Closes https://github.com/vercel/next.js/issues/39538
 - https://github.com/swc-project/swc/pull/5485
   - Closes https://github.com/vercel/next.js/issues/39412
 - https://github.com/swc-project/swc/pull/5498
   - Closes https://github.com/vercel/next.js/issues/39360
2022-08-17 11:21:57 +00:00
Noel Kim (김민혁)
40f0eb126b
feat(next-swc/modularize_imports): Add Kebab case (#38583)
* Feat: Add Kebab case

* Add document

* Feat: Add Kebab case

* Add document

* Add Test cases
2022-08-10 22:51:05 -05:00
OJ Kwon
58b920d5ba
feat(next-swc/wasm): export async interfaces (#39231)
* build(cargo): update dependencies

* feat(next-swc/wasm): export async interfaces

* feat(next/swc): use async wasm binding interface

* refactor(next/swc): allow to fallback for non-async published pkg

* Apply suggestions from code review

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-03 20:55:02 -05:00
Donny/강동윤
eb0e161f2e
Update swc minifier (#39158)
This PR applies

 - https://github.com/swc-project/swc/pull/5333
   - Closes https://github.com/vercel/next.js/issues/39090
2022-07-29 03:26:28 +00:00
Donny/강동윤
4eac75bbc9
feat(next-swc): Update swc (#39055)
## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-07-28 16:04:02 +00:00
Donny/강동윤
f694e6c42f
chore(deps): Update swc (#38347)
This PR updates swc to fa66ee86e5
2022-07-11 15:10:57 +00:00
OJ Kwon
46dde0dd4a
feat(next/swc): setup native next-swc crash reporter with platform supports (#38221)
This is second attempt to https://github.com/vercel/next.js/pull/38076 . Most of changes are identical to previous PR. Main difference is introducing features `native-tls` and `rustls` for the sentry's downstream feature. Few platform targets we build (mostly where we cross compiles) fails to find native openssl for the specified target. For those, we falls back to rustls instead. The only exception is aarch64_windows, neither openssl nor rustls can be compiled straightforwardly, For those platform we bail out and do not init sentry at all. There are nearly 0 users on aarch64_windows anyway. We could try to located target's openssl binary, but the effort required seems not worth enough. 

Also PR changed `server_name` property to not to include real device hostname to avoid possible PII concerns.

## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-07-07 17:37:50 +00:00
JJ Kasper
0b762433f5
Revert "feat(next/swc): setup native next-swc crash reporter" (#38170)
Revert "feat(next/swc): setup native next-swc crash reporter (#38076)"

This reverts commit 42e3365575.
2022-06-29 14:51:12 -05:00
OJ Kwon
42e3365575
feat(next/swc): setup native next-swc crash reporter (#38076)
This PR attempts to setup native crash reporter for `next-swc`. Currently, it uses sentry internally, but it is subject to change depending on the usecase & needs. In any case it won't be breaking changes since this is not transparent to the end users.

PR sets up basic, minimal setup to collect crash reports only at the moment. We may want to expand & collect more data in native next-swc, but it is not clear what we need to collect / and I believe most cases next.js's js context can collect those data via existing telemetry. Crash report is an exception native handler can perform much better by having it in native context directly. While this is sent to different endpoint than telemetry, it is considered as same opt-in configuration. If telemetry is disabled, crash reporter won't collect as well. 

The information collected by the reporter is minimally configured by sentry's sdk. These are the informations collected for example: 

- device arch / family / model
- os kernel version / name / version
- runtime (rust) version / channel
- sentry sdk
- panic backtrace
- next.js release version
- device host name

There's no per-system uuid configurations yet.

It may need some audit if we need to omit some data included in above, while most of them seems ok to me.

## 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.
- [ ] 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-06-28 23:49:21 +00:00
Donny/강동윤
ee7648ae0a
Update swc (#37607)
* Update swc

* Update again

* fixup

* Bump

* Update

* fixup

* Update test refs

* Update minifier

* Parser

* Update swc

* Bump version

* Update

* fixup

* Update test refs

* Bump

* Update `@swc/helpers`

* lockfile

* lints

* FIx

* [TRY] Update @swc/core
2022-06-21 10:51:47 -05:00
Donny/강동윤
748ce123b2
Add swcMinifyDebugOptions (#37172)
This also updates swc crates to 7eac561639

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-05-29 03:53:57 +00:00
OJ Kwon
951b29e5cc
build(actions): skip plugin features for non supported platform (#37229)
* build(actions): skip plugin features for non supported platform

* test builds

* update turbo config

* Revert "test builds"

This reverts commit 50bdb9765b9fcd4c09e4dcf6566f512ac1a30da0.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-05-26 20:32:43 -05:00
OJ Kwon
fc61428db1
feat(next/swc): support experimental swc plugins (#36790)
* build(cargo): build swc with plugin support

* feat(next): expose experimental swcplugins config

* docs(compiler): add description

* build(cargo): resolve feature conflicts

* build(cargo): resolve build conflict

* Update docs/advanced-features/compiler.md

Co-authored-by: Maia Teegarden <dev@padmaia.rocks>

Co-authored-by: Maia Teegarden <dev@padmaia.rocks>
2022-05-26 15:16:26 -07:00
Donny/강동윤
a463553da2
Update swc (#37149)
* Update swc

* Update test refs

* Update test refs
2022-05-24 00:56:45 -05:00
Donny/강동윤
76fbae93fc
Update swc (#37148) 2022-05-23 23:50:25 -05:00
Donny/강동윤
9732463f92
Update swc (#37009)
This PR

 - updates swc crates to 224a2ea8b6

 - resolves`https://github.com/vercel/next.js/discussions/30237?sort=new#discussioncomment-2759673`

 - resolves `https://github.com/vercel/next.js/discussions/30237?sort=new#discussioncomment-2780370`


<img width="1840" alt="image" src="https://user-images.githubusercontent.com/29931815/169214393-5798681f-2a48-48b8-ba4a-24e4360e4ea5.png">
2022-05-19 20:29:04 +00:00
Donny/강동윤
16bcb070d8
Update swc (#36972)
This PR updates swc to f226c0a3d8


This PR resolves

 - `https://github.com/vercel/next.js/discussions/30237#discussioncomment-2739632`

<img width="1840" alt="image" src="https://user-images.githubusercontent.com/29931815/168766189-c9412011-afae-4888-9b43-045e91478771.png">

Which is related to `styled-components`
2022-05-17 14:15:24 +00:00
Donny/강동윤
359d03f899
Update swc (#36745)
This PR

 - updates swc crates to a09bfc22f8

 - resolves https://github.com/vercel/next.js/discussions/30237?sort=new#discussioncomment-2693663

 - resolves https://github.com/vercel/next.js/discussions/30237?sort=new#discussioncomment-2749346

![image](https://user-images.githubusercontent.com/29931815/168412242-6b72fc0e-788e-446b-804e-f071e0e67b73.png)


 - applies various bugfixes
2022-05-16 09:37:21 +00:00
OJ Kwon
837e0a6af8
feat(next-swc): introduce experimental tracing support for swc (#35803)
* feat(next-swc/napi): expose initcustomtracesubscriber

* feat(next/config): enable experimental swcTrace

* feat(trace): add trace for emotion transform

* refactor(swc): use .next for the default trace output

* refactor(swc): teardown subscriber via drop

* refactor(swc/trace): simplify config

* refactor(swc/trace): adjust teardown
2022-05-02 15:20:59 -07:00
Donny/강동윤
38aa6d7140
Update swc (#36535)
This PR updates swc to a72f436148


This PR applies

 - https://github.com/swc-project/swc/pull/4452
   - Fixes `yield*` of async generators in async generators.
   - Fixes name mangling of injected helpers.
     - Note: This only applies to tiny files which enables lots of helpers.
 - https://github.com/swc-project/swc/pull/4468
   - Fixes newer version of react.
2022-04-28 10:14:48 +00:00
Donny/강동윤
f2c3ef8318
Update swc (#36477)
* Update

* Update swc

* Update again

* Fix

* log

* Fix

* clippy

* Update

* Fix
2022-04-27 14:28:46 +02:00
Donny/강동윤
b4d4f24129
Update swc (#36351)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-04-22 09:20:44 +02:00
Donny/강동윤
9456fc6b3b
Update swc (#36269)
This PR updates swc crates to 33e4661090



I'll undraft this after verifying some more fixes.


 - Resolves https://github.com/vercel/next.js/discussions/30237#discussioncomment-2587218
<img width="1840" alt="image" src="https://user-images.githubusercontent.com/29931815/163984412-cd887458-9507-4f20-9fd9-e0864d3904d7.png">


 - Resolves https://github.com/vercel/next.js/discussions/30237#discussioncomment-2585357


<img width="1840" alt="image" src="https://user-images.githubusercontent.com/29931815/163990124-10c7dc62-7613-444b-bffd-69b69c880592.png">
2022-04-21 10:52:39 +00:00
Donny/강동윤
cbb64ee554
Update swc (#36187)
This PR updates swc crates to b8d9a58f13


- Closes #35811
- Closes #34811
  - I tested with https://github.com/balazsorban44/issue-34811

<img width="1840" alt="image" src="https://user-images.githubusercontent.com/29931815/163574875-d7392c4c-b1f1-4503-aac1-35a26c9d7ec2.png">

- Closes #34715
  - I tested with https://github.com/cungminh2710/nextjs-swc-mapbox

<img width="1840" alt="image" src="https://user-images.githubusercontent.com/29931815/163574677-9733dd69-9938-4e3e-b2f1-bfbd6db9e20c.png">


 - This fixes the bug reported in the comment (https://github.com/vercel/next.js/issues/36127#issuecomment-1099794402), but I didn't test the issue itself.
2022-04-15 14:34:32 +00:00
Donny/강동윤
4bf01d4ec8
feat(next-swc): Update css parser (#36114)
This only applies 81370d16cb

This fixes parsing of legacy `calc`s.
2022-04-13 09:09:52 +00:00
Donny/강동윤
16f7084e7f
feat(next-swc): Update swc crates (#35996)
* Move

* Adjust

* publish = false

* Tree

* Move tests

* fixup

* Split `emotion`

* Split `styled_jsx`

* Split `styled_jsx`

* fmt

* `--fix`

* clippy

* Update crates

* fixup

* publish

* Bump

* Rename

* authors

* Update

* More update

* Oh

* Update test refs

* Update test refs

* Update again

* Fix
2022-04-11 11:59:16 +02:00
Donny/강동윤
fdfa3c7bae
feat(next-swc): Update swc crates (#35395)
* Update crates

* fixup

* fix type

* Update test refs

* Update css crates

* Update test refs

* Update test refs

* Update test refs

* SourceMap

* Fix?

* Update crates

* Fix

* Update test refs

* Update test refs

* Update error reporter

* Update snapshots

* Update snapshots

* Bug?

* Fix

* Fix lint

* Update swc again

* fixup

* Update test refs

* Fix

Co-authored-by: Maia Teegarden <dev@padmaia.rocks>
2022-03-30 15:13:40 -07:00
Heyang Zhou
860c97ccf5
SWC import modularization plugin (#34969) 2022-03-22 14:20:57 +01:00
LongYinan
2e16d02faa
SWC emotion transform plugin (#34687) 2022-03-15 08:51:15 +01:00
Donny/강동윤
e57d621fb3
feat(next-swc): Update crates (#35133)
This PR updates crates related to ecmascript to d62ef6498d

I'll update css crates separately.


This PR also reduces the size of binary.
2022-03-11 04:58:01 +00:00
Donny/강동윤
6814852ffa
feat(next-swc): Update swc (#34878)
* Update swc

* lockfile

* Update more swc crates

* Update minifier

* chore: update types

* style: fix

* Update deps

Co-authored-by: evilebottnawi <sheo13666q@gmail.com>
2022-03-01 09:41:31 -08:00
JJ Kasper
271dff5be8
Update swc crates (#34491)
* Revert "Revert swc css bump temporarily (#34440)"

This reverts commit 01524ef20f.

* Update css crates

Co-authored-by: Donny/강동윤 <kdy1997.dev@gmail.com>
2022-02-18 14:02:54 -06:00
JJ Kasper
01524ef20f
Revert swc css bump temporarily (#34440)
This reverts the below two swc crates bumps to unblock testing changes while an issue with `styled-jsx` interpolation is investigated, we can reland after that issue is addressed. 

Reverts https://github.com/vercel/next.js/pull/34408
Reverts https://github.com/vercel/next.js/pull/34355

x-ref: [slack thread](https://vercel.slack.com/archives/C02HY34AKME/p1645032079994029)
2022-02-16 20:05:39 +00:00
Donny/강동윤
73581f37f3
feat(next-swc): Update swc (#34408)
This fixes wrong lint for overloads with `export default`
2022-02-16 15:23:36 +00:00
Donny/강동윤
4500cb7d8c
feat(next-swc): Update swc (#34355)
This update swc crates to

a5b3dd815b

from 

3b7e594bc7


Note that swc does not hoist imports anymore, as runtime will hoist it anyway.


---


 - Closes https://github.com/vercel/next.js/issues/33946
2022-02-15 17:24:59 +00:00
Donny/강동윤
f1ff0fb626
feat(next-swc): Update swc (#34045)
This applies 

 - https://github.com/swc-project/swc/pull/3462

This resolves https://github.com/vercel/next.js/discussions/30237#discussioncomment-2114870


 - https://github.com/swc-project/swc/pull/3463

This resolves https://github.com/vercel/next.js/discussions/30237#discussioncomment-2109335

 - https://github.com/swc-project/swc/pull/3480

This resolves https://github.com/vercel/next.js/discussions/30237#discussioncomment-2068850
2022-02-08 11:48:25 +00:00
Donny/강동윤
4bd76ff5df
feat(next-swc): Update swc (#33724)
This PR applies

 - https://github.com/swc-project/swc/pull/3350

which fixes lots of minifier issues.

 - https://github.com/swc-project/swc/pull/3391

This fixes the regression of evaluatior.

 - https://github.com/swc-project/swc/pull/3436

This fixes codegen bugs.

 - https://github.com/swc-project/swc/pull/3425

This improves compression.

 - https://github.com/swc-project/swc/pull/3400

This fixes some transform bugs.

 - https://github.com/swc-project/swc/pull/3392
 
This implements more terser options.
2022-02-03 17:39:37 +00: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
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
Donny/강동윤
f0e31ee842
feat(next-swc): Update swc (#33675)
This PR applies

 - https://github.com/swc-project/swc/pull/3367
2022-01-26 05:46:29 +00:00
Donny/강동윤
9dd0399dd8
feat(next-swc): Update swc (#33628)
This PR applies


 - https://github.com/swc-project/swc/pull/3360

Closes https://github.com/vercel/next.js/issues/33600
2022-01-25 09:22:22 +00:00
Donny/강동윤
0fb1183973
feat(next-swc): Update swc (#33595)
This PR applies

 - https://github.com/swc-project/swc/pull/3344

Resolves https://github.com/vercel/next.js/discussions/30237#discussioncomment-2014245

 - https://github.com/swc-project/swc/pull/3348

 - https://github.com/swc-project/swc/pull/3352

This fixes `jsc.experimental.keepImportAssertions`.
2022-01-24 13:46:09 +00:00
Donny/강동윤
8ff9785d08
Update swc (#33514)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-01-21 12:49:38 +01:00
Donny/강동윤
a54eb376e1
feat(next-swc): Update swc (#33485) 2022-01-20 09:54:56 +01:00
Donny/강동윤
3574b91b48
feat(next-swc): Update swc (#33461)
This PR applies

 - https://github.com/swc-project/swc/pull/3313

 - https://github.com/swc-project/swc/pull/3310

Fixes https://github.com/vercel/next.js/issues/31077
2022-01-19 15:57:39 +00:00