StanzaJS Discussion - 2023-03-16


  1. timpisti Hi all :)
  2. timpisti I try to complle & build the stanza@12.18, and I get this error:
  3. timpisti npm run compile > stanza@12.18.0 compile > tsc -p . src/jingle/sdp/Protocol.ts:330:55 - error TS2345: Argument of type '{ direction: JingleApplicationDirection; id: number; uri: string; }' is not assignable to parameter of type 'SDPHeaderExtension'. Property 'atrributes' is missing in type '{ direction: JingleApplicationDirection; id: number; uri: string; }' but required in type 'SDPHeaderExtension'. 330 media.rtpParameters.headerExtensions.push({ ~ 331 direction: sendersToDirection(role, ext.senders || 'both'), ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ... 333 uri: ext.uri ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 334 }); ~~~~~~~~~~~~~ node_modules/sdp/sdp.d.ts:47:5 47 atrributes: string | undefined; ~~~~~~~~~~ 'atrributes' is declared here.
  4. timpisti the build process is stopping too (with much less readable error)
  5. timpisti I assume it's good to know.
  6. Alex timpisti, can confirm this. Just tried to compile as well
  7. timpisti \o/
  8. Alex just add attributes: undefined and it will compile: ``` for (const ext of application.headerExtensions || []) { media.rtpParameters.headerExtensions.push({ direction: sendersToDirection(role, ext.senders || 'both'), id: ext.id, uri: ext.uri, atrributes: undefined }); } ```
  9. Alex not sure if we need to pass any attribute here
  10. timpisti okay, and it will build it too?
  11. Alex yes
  12. Alex I may send a PR on github later
  13. timpisti awesome, thank you
  14. timpisti now I try to build: [webpack-cli] ReferenceError: BigInt is not defined
  15. Alex https://github.com/legastero/stanza/pull/497
  16. timpisti awesome, I do this on (oooold) linux, and windows too. Linux build error: 'Bigint is not defined'. Windows error: The syntax of the command is incorrect. Error: Command failed: mkdir dist/npm The syntax of the command is incorrect.
  17. Alex I am Windows right now (not in WSL). Normal compile works. Have not tried webpack yet, because I use Vue with Vite, but have other problems there See my screne above
  18. Alex trying to see now if it works for me when I include the sources as a project reference
  19. timpisti on windows: npm run compile works, npm run compile:webpack get errors
  20. Alex same here. It opens a URI with empty stats in the browser. But I am not a webpack expert
  21. timpisti Can't resolve 'crypto', 'dns', 'stream'
  22. timpisti okay, thanks for the help anyway. as I see, stanza doesn't support connection attach?
  23. Alex which protocol/XEP is connection attach?
  24. timpisti well, as I see, there is a support in eJabberd | Openfire and strophe. http://strophe.im/strophejs/doc/1.1.3/files/strophe-js.html#Strophe.Connection.attach
  25. Alex Oh, I see. ya, this is not supported by stanza AFAIK. Also not sure if this feature makes still sense these days. This was used like 10+ years go
  26. timpisti https://xmpp.org/extensions/xep-0206.html - the example
  27. timpisti Example 8
  28. timpisti In webapps, after login, we didn't want to sore the user password. If the user refresh te page, the session sould be keeped, but without a connection restart, the connection process have to be restarted with the request of user password.
  29. timpisti ..didn't want to store...
  30. Alex this feature is called BOSH prebind
  31. timpisti yes
  32. timpisti I already done the server side, and now didn't find in stanza
  33. timpisti As I rememebered it was in stanza.io, but i'm not clear
  34. Alex is looking
  35. Alex https://github.com/legastero/stanza/blob/3ac2ba9439e5c64ca7c55eb056328c8ce27675fc/src/transports/bosh.ts#L208
  36. timpisti Well, I find something
  37. timpisti https://github.com/conversejs/converse.js/issues/550
  38. Alex converse is not using stanza, its basedon strophe
  39. timpisti ... I find sometinh lost witn https://github.com/otalk/stanza.io/issues/43
  40. timpisti but it's 404
  41. Alex ya, otalk was removed a while ago AFAIK from github
  42. Alex maybe you can find some forks
  43. timpisti all right, thank you :)
  44. timpisti 'ill be fine without it, but a working bundle would be nice, for the new features :P
  45. Alex looks like its supported, you can pass the sid i the options
  46. Alex looks like its supported, you can pass the sid in the options
  47. Alex https://github.com/legastero/stanza/blob/3ac2ba9439e5c64ca7c55eb056328c8ce27675fc/src/transports/bosh.ts#L194
  48. timpisti awesome, but the connection need SID, JID and RID (if I1m not wrong...
  49. Alex yes, you are right
  50. Alex there are optiond for rid and sid and Bosh transport is using and supporting them
  51. timpisti ((I use stanza.io for years, strophe.js use DOM, and cannot work in a WebWorker...))
  52. timpisti oookay, I look for it
  53. Alex stanza is also my favorite
  54. Alex working on a new project and having some issues with the latest available packackes. Hopefully in can resolve them
  55. timpisti Keep thefight on ! :D
  56. timpisti do you know a successfully builded version > 12 ?
  57. Alex no
  58. Alex fixed my vite errors by adding all the required polyfills to the configuration