Comments (20)
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.
Any updates on this?
Edit: Looks to be a problem with rollup-plugin-typescript
, see this issue: rollup/rollup-plugin-typescript#62
from echo.
Types added to 1.5.0
from echo.
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.
@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.
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.
+1
from echo.
+1 Shame how Echo is written in TS yet I can't take advantage of types because of this...
from echo.
@tlaverdure any chance you could take a look at this?
from echo.
+1
from echo.
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.
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.
@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.
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.
How would you tackle this in a way that doesn't breaks the setup for all the existing Echo users?
from echo.
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.
package.json must to add "typings": "dist/echo.d.ts"
like this
https://github.com/yoyo930021/echo/blob/239ed841f35394fe98a95c5283dd16fabdd041cb/package.json#L6
from echo.
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.
Send a PR
from echo.
laravel-echo@^1.5.2...
having this issue - not quite sure how to fix
from echo.
Related Issues (20)
- TS2564: Property 'namespace' has no initializer and is not definitely assigned in the constructor. HOT 1
- Laravel echo and pusher auth error on ubuntu 22.04 HOT 1
- Laravel Echo is not subscribing to private channel HOT 5
- Release 1.14.1 dist doesn't reflect latest source changes HOT 4
- React native: undefined is not an object (evaluating 'this.connector.channel') HOT 1
- #listenToAll for NullConnector HOT 1
- #encryptedPrivate does not work with NullConnector HOT 1
- PresenceChannel interface missing 'Whisper' method HOT 2
- Implement `.listenOnce` and `.isListening` HOT 1
- [Bug] PresenceChannel interface missing 'Whisper' method HOT 2
- Nuxtjs + VUE 2 to update vue 3 + vite not working echo HOT 2
- Always got pusher ouput while using socket.io HOT 1
- Not subscribing to Echo when you open SPA as PWA from Homescreen HOT 4
- All the names of the events must be prefixed with a dot HOT 1
- Uncaught TypeError: event is undefined HOT 2
- Connection fails in Chrome, works just fine in FF HOT 1
- Export connectors and channels alongside with Echo and abstract classes HOT 2
- Laravel Echo with Socket.io HOT 1
- Centrifugo Connector HOT 1
- Fatal error when using channel.listen HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from echo.