Giter VIP home page Giter VIP logo

Comments (4)

sannajammeh avatar sannajammeh commented on July 2, 2024 1

It seems have some issues with codesplit, maybe I should mark this shared-runtime feature as experimental..as it's not super reliable now. I would probably go with sth else in #540

We might stay on this route as we heavily rely on .server-runtime. We had issues where a client module still wouldn't codesplit correctly until the server module was marked .server-runtime

I hope #540 also supports react server only runtime declarations.

from bunchee.

amannn avatar amannn commented on July 2, 2024

I just ran into the same issue.

Here's a reproduction: amannn/bunchee-test@a9e6ce6

The relevant part is that there's a type created in the shared runtime that is then referenced in an entry point. As a result, the file dist/utils-shared-BdVwpBM3.js is created which contains only the type declaration and should therefore use .d.ts.

Using a .js file causes a TypeScript error for consumers in my project:

TS8017: Signature declarations can only be used in TypeScript files.

from bunchee.

huozhi avatar huozhi commented on July 2, 2024

It seems have some issues with codesplit, maybe I should mark this shared-runtime feature as experimental..as it's not super reliable now. I would probably go with sth else in #540

from bunchee.

sannajammeh avatar sannajammeh commented on July 2, 2024

@amannn @huozhi
As a temporary fix, I implemented a postbuild step which assumes the default structure from bunchee prepare. Modify it to your liking.

https://gist.github.com/sannajammeh/0d2ef984d9a076a90dae9ba27910ea5e

from bunchee.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.