Commit Graph

5 Commits

Author SHA1 Message Date
Luke Sandberg e2262334f8 [turbopack] Implement improved deobfuscation for free calls and module identifiers. (#85060)
Improve deobfuscation of 'imported module identifier' and attempt to deobfuscate error messages logged by the server.

Before
```
 ⨯ TypeError: (0 , __TURBOPACK__imported__module__$5b$project$5d2f$examples$2f$with$2d$turbopack$2f$app$2f$foo$2e$ts__$5b$app$2d$rsc$5d$__$28$ecmascript$29$__.foo) is not a function
    at Page (app/page.tsx:5:6)
  3 | export default function Page() {
  4 |   /** @ts-ignore */
> 5 |   foo();
    |      ^
  6 |   return <h1>Hello, Next.js!</h1>;
  7 | }
  8 | {
```
after 
```
 ⨯ TypeError: {imported module ./examples/with-turbopack/app/foo.ts}.foo is not a function
    at Page (app/page.tsx:5:6)
  3 | export default function Page() {
  4 |   /** @ts-ignore */
> 5 |   foo();
    |      ^
  6 |   return <h1>Hello, Next.js!</h1>;
  7 | }
  8 | {
```

Similarly in devtools
before:

![image.png](https://app.graphite.dev/user-attachments/assets/fd50d94a-d34a-4026-862e-0ca8ee6658ba.png)

after

![image.png](https://app.graphite.dev/user-attachments/assets/d9080ed7-29c8-428a-831a-9bbcd818cc3e.png)


This is definitely an improvement but i am not sure i put the deobfuscation logic in the best place for the console case.  Happy for feedback
2025-10-21 13:54:28 -07:00
Remco Haszing 7aa5d16231 Use the automatic runtime for type checking (#83159)
Co-authored-by: Sebastian "Sebbie" Silbermann <silbermann.sebastian@gmail.com>
2025-09-02 12:35:42 +02:00
Benjamin Woodruff 8fa42deefd refactor(napi): Implement napi traits for RcStr (#79806)
This lets us use `RcStr` directly in function arguments and as part of `#[napi(object)]`s.

*You can just `RcStr` things!*

Here's an example of rspack doing something similar for a custom napi type: https://github.com/web-infra-dev/rspack/blob/35f1126963d5ba6860e9eba939fd5d62f9aa217f/crates/rspack_regex/src/napi.rs
2025-05-28 17:09:45 -07:00
Arian 832cbb3330 chore: migrate basic-css example from page router to app router (#62980)
### Adding or Updating Examples

Migrate the basic-css example from page router to app router. If it
needs further updates, Please let me know

Happy to contribute

---------

Co-authored-by: Steven <steven@ceriously.com>
2024-03-07 15:44:13 +00:00
Max Proske 3d482cffbb Convert basic-css example to TypeScript (#38091)
Converted basic CSS example over to TypeScript to match the Contribution guidelines.



## 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-29 11:11:53 +00:00