Giter VIP home page Giter VIP logo

Comments (20)

cre8 avatar cre8 commented on July 20, 2024 2

It should be possible to write write a full TS based echo service that will be compiled to a JS version. But right now the module.exports statements break it because they are made for nodejs, not for TS.

from echo.

jakewtaylor avatar jakewtaylor commented on July 20, 2024 2

Any updates on this?

Edit: Looks to be a problem with rollup-plugin-typescript, see this issue: rollup/rollup-plugin-typescript#62

from echo.

tlaverdure avatar tlaverdure commented on July 20, 2024 2

Types added to 1.5.0

from echo.

driesvints avatar driesvints commented on July 20, 2024 1

So looking at the comments above I can conclude that this isn't really an issue with Echo but rather with your module bundler? Feel free to reply if you believe otherwise.

from echo.

FrozenDroid avatar FrozenDroid commented on July 20, 2024 1

@driesvints I'll have a look and see if I can write a PR. Not 100% sure if I can make it work for existing Echo users, though... I'll try :) If not, shouldn't be too hard to fix the breaking change for users.

from echo.

yoyo930021 avatar yoyo930021 commented on July 20, 2024 1

I'm sad for this.

If anyone need this,
Temporary solution:

yarn add yoyo930021/echo#release 
# or
npm install yoyo930021/echo#release

I will try to fork project or add to @types/lavavel-echo .

from echo.

koenverburg avatar koenverburg commented on July 20, 2024

+1

from echo.

FrozenDroid avatar FrozenDroid commented on July 20, 2024

+1 Shame how Echo is written in TS yet I can't take advantage of types because of this...

from echo.

FrozenDroid avatar FrozenDroid commented on July 20, 2024

@tlaverdure any chance you could take a look at this?

from echo.

neumannjan avatar neumannjan commented on July 20, 2024

+1

from echo.

FrozenDroid avatar FrozenDroid commented on July 20, 2024

Can we get this fixed? I don't know enough about module resolution to send a PR but I'd really like to get this fixed.

from echo.

neumannjan avatar neumannjan commented on July 20, 2024

I tried fixing this by using a different Rollup TypeScript plugin, and even though I had partial success, there were still bugs: missing typings for one particular class, which there was no reason for.

I suggest removing Rollup entirely and replacing it with Webpack 4. It will work then, as Webpack is the standard.

from echo.

zwacky avatar zwacky commented on July 20, 2024

@kogli you may wanna try this approach: https://stackoverflow.com/a/41337762/825444

basically have "start": "tsc -p . && rollup -c" in your npm scripts.

from echo.

FrozenDroid avatar FrozenDroid commented on July 20, 2024

I definitely believe otherwise.

It should be possible to write write a full TS based echo service that will be compiled to a JS version. But right now the module.exports statements break it because they are made for nodejs, not for TS.

If it were exported the TypeScript way, it'd work fine.

from echo.

driesvints avatar driesvints commented on July 20, 2024

How would you tackle this in a way that doesn't breaks the setup for all the existing Echo users?

from echo.

driesvints avatar driesvints commented on July 20, 2024

As @taylorotwell has mentioned in the closed PR we will not be merging in more Typescript support. You're free to fork Echo and publish a version of Echo with more Typescript support.

Sorry for this. Hope you all understand.

from echo.

yoyo930021 avatar yoyo930021 commented on July 20, 2024

@tlaverdure

package.json must to add "typings": "dist/echo.d.ts"
like this
https://github.com/yoyo930021/echo/blob/239ed841f35394fe98a95c5283dd16fabdd041cb/package.json#L6

from echo.

ragingdave avatar ragingdave commented on July 20, 2024

If this is what's needed can it be added asap? Currently in a typescript project >v1.5 means I can't use it because typescript doesn't know about a constructor. as well as it just not loading:

 "export 'Echo' was not found in 'laravel-echo'

from a build failure

from echo.

tlaverdure avatar tlaverdure commented on July 20, 2024

Send a PR

from echo.

simonmaass avatar simonmaass commented on July 20, 2024

laravel-echo@^1.5.2...
having this issue - not quite sure how to fix

from echo.

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.