rsnext/packages/next-swc/crates
Donny/강동윤 4bbf9b6c70
Add __nextjs_pure helper (#57286)
### What?

Safely drop `__nextjs_pure` from next internals in transform

```js
import {__nextjs_pure} from 'next/dist/build/swc/helpers'

__nextjs_pure(console.log("test!"))


```

becomes


```js
/*#__PURE__*/ console.log("test!");

```

so it will be dropped by the minifier - terser and swc minifier will
both work.

### Why?

Adding pure comments from JS world with swc transform is complex. This
would be a helper for the case if we want to create "pure" expressions.


### How?



Closes WEB-1829

---------

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2023-10-23 16:44:44 -07:00
..
core Add __nextjs_pure helper (#57286) 2023-10-23 16:44:44 -07:00
napi Turbopack: support more server code in tracing error stack frames (#57156) 2023-10-20 17:09:10 -07:00
next-api Leverage defineEnv for all environment variables in Turbopack (#57196) 2023-10-22 15:37:48 -07:00
next-build Leverage defineEnv for all environment variables in Turbopack (#57196) 2023-10-22 15:37:48 -07:00
next-core Leverage defineEnv for all environment variables in Turbopack (#57196) 2023-10-22 15:37:48 -07:00
next-transform-dynamic Reland "feat(turbopack): support basic next/dynamic" (#56934) 2023-10-18 02:53:40 +00:00
next-transform-font Update swc_core to v0.83.12 (#55216) 2023-09-15 17:41:05 +02:00
next-transform-strip-page-exports prettier fix for next-swc (#47873) 2023-04-19 19:44:27 +02:00
wasm Turbopack: Implement Server Actions (#53890) 2023-10-04 23:33:21 +00:00