blitz-js / blitz

⚡️ The Missing Fullstack Toolkit for Next.js
https://Blitzjs.com
MIT License
13.7k stars 798 forks source link

when generating the Route manifest, a route using a HOC wrapper will not be generated correctly #4358

Closed bezalel6 closed 3 months ago

bezalel6 commented 4 months ago

What is the problem?

when generating the Route manifest, a route using a HOC wrapper will be named after the HOC. which would obv be a problem, especially since a HOC is meant to be used across an application.

Paste all your error logs here:

Paste all relevant code snippets here:

for example:

const Products: BlitzPage = () => {
    return <ProductsList source={{source: 'all-products'}}></ProductsList>
}

export default withSuspense(Products)

the generated route will be withSuspence, and not Products.

What are detailed steps to reproduce this?

exporting a default component and wrapping it with any HOC. the generated route will be named after the HOC and not the component itself

Run blitz -v and paste the output here:

Blitz version: 2.0.9 (global)
Blitz version: 2.0.10 (local)
Windows 11 | win32-x64 | Node: v20.15.0

 Package manager: npm

  System:
    OS: Windows 10 10.0.22631
    CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor
    Memory: 15.60 GB / 31.91 GB
  Binaries:
    Node: 20.15.0 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    @blitzjs/auth: ^2.0.10 => 2.0.10
    @blitzjs/next: ^2.0.10 => 2.0.10
    @blitzjs/rpc: ^2.0.10 => 2.0.10
    @prisma/client: ^5.16.2 => 5.16.2
    blitz: ^2.0.10 => 2.0.10
    next: ^14.2.5 => 14.2.5
    prisma: ^5.16.2 => 5.16.2
    react: ^18.3.1 => 18.3.1
    react-dom: ^18.3.1 => 18.3.1
    typescript: ^5.5.3 => 5.5.3

Please include below any other applicable logs and screenshots that show your problem:

No response