rsnext/packages
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
..
create-next-app v13.5.7-canary.19 2023-10-23 23:24:21 +00:00
eslint-config-next v13.5.7-canary.19 2023-10-23 23:24:21 +00:00
eslint-plugin-next v13.5.7-canary.19 2023-10-23 23:24:21 +00:00
font v13.5.7-canary.19 2023-10-23 23:24:21 +00:00
next Add __nextjs_pure helper (#57286) 2023-10-23 16:44:44 -07:00
next-bundle-analyzer v13.5.7-canary.19 2023-10-23 23:24:21 +00:00
next-codemod v13.5.7-canary.19 2023-10-23 23:24:21 +00:00
next-env v13.5.7-canary.19 2023-10-23 23:24:21 +00:00
next-mdx v13.5.7-canary.19 2023-10-23 23:24:21 +00:00
next-plugin-storybook v13.5.7-canary.19 2023-10-23 23:24:21 +00:00
next-polyfill-module v13.5.7-canary.19 2023-10-23 23:24:21 +00:00
next-polyfill-nomodule v13.5.7-canary.19 2023-10-23 23:24:21 +00:00
next-swc Add __nextjs_pure helper (#57286) 2023-10-23 16:44:44 -07:00
react-dev-overlay v13.5.7-canary.19 2023-10-23 23:24:21 +00:00
react-refresh-utils v13.5.7-canary.19 2023-10-23 23:24:21 +00:00
third-parties v13.5.7-canary.19 2023-10-23 23:24:21 +00:00