Commit graph

7 commits

Author SHA1 Message Date
OJ Kwon
655227f4e1
Revert "refactor(analysis): rust based page-static-info, deprecate js parse interface in next-swc" (#62838)
Reverts vercel/next.js#61832

Closes PACK-2654
2024-03-04 21:43:56 +00:00
OJ Kwon
372c74b620
refactor(analysis): rust based page-static-info, deprecate js parse interface in next-swc (#61832)
Reenabling https://github.com/vercel/next.js/pull/59300 with fixes for
the unsupported inputs.

Closes [PACK-2088](https://linear.app/vercel/issue/PACK-2088)

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2024-03-04 08:07:36 -08:00
Tobias Koppers
3a7fea4034
Revert "refactor(analysis): rust based page-static-info, deprecate js parse interface in next-swc" (#61021)
Reverts vercel/next.js#59300

Breaks `app/page.mdx` files

Closes PACK-2279
2024-01-23 12:00:36 +01:00
OJ Kwon
9d5f62eb4a
refactor(analysis): rust based page-static-info, deprecate js parse interface in next-swc (#59300)
### Description

This PR refactors existing `analysis/get-static-page-info`, moves over
most of parse / ast visiting logic into next-swc's rust codebase. By
having this, turbopack can reuse same logic to extract info for the
analysis. Also as a side effect, this removes JS side parse which is
known to be inefficient due to serialization / deserialization.

The entrypoint `getPageStaticInfo` is still in the existing
`get-page-static-info`, only for extracting / visiting logic is moved.
There are some JS specific context to postprocess extracted information
which would require additional effort to move into.


Closes PACK-2088
2024-01-22 14:42:28 -08:00
Sukka
25d34057d6
feat: enhance warning messages about unanalyzable config field (#38907)
x-ref: #38750
x-ref: https://github.com/vercel/next.js/pull/38750#discussion_r926203439

cc @ijjk 

The PR implements the details about un-extractable fields in the `UnsupportedValueError`.

The PR also enhances the warning message about the unrecognizable `config` field. Now the warning message will look like this:

```
warn  - Next.js can't recognize the exported `config` field in route "/unsupported-value-type":
Unsupported node type "CallExpression" at "config.runtime".
The default config will be used instead.
Read More - https://nextjs.org/docs/messages/invalid-page-config
```

The corresponding production test case has also been updated.
2022-07-22 19:31:47 +00:00
Sukka
02c78a5c15
fix(#38743): config.runtime support template literal (#38750)
## Bug

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

Fixes #38743.
Fixes: https://github.com/vercel/next.js/pull/38750

The PR adds basic `TemplateLiteral` support for static analysis.

The corresponding re-production of #38743 has also been implemented in e2e tests.
2022-07-21 19:56:52 +00:00
Gal Schlezinger
56e760a203
[build] validate the exported config values (#38370)
Right now if people will accidentally export a typo like `runtime: 'experimental-egde'` we will fail silently.
This commit ensures we will throw and fail loudly when such typos occur.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2022-07-06 11:06:57 +00:00