I made an event emitter library for Teal #872
Replies: 1 comment 4 replies
-
Thanks for the feedback! Main maintainer of cyan here.
I would like to have more Cyan <-> Luarocks integration in the future for the reasons you've stated above. If there are certain features you had in mind I'd appreciate if you opened some issues in the cyan repo.
Not an explicit tutorial, but I recently ported Cyan's tests to Teal and that could be a good jumping off point. The gist of it is that we have a |
Beta Was this translation helpful? Give feedback.
-
I made a somewhat unique strongly typed event emitter library for Teal/Lua: https://github.com/mtdowling/emitter.tl. I also published it to Luarocks in way that includes the Lua and Teal code, based on advice from a previous discussion.
Like others in the discussion board, I thought I'd give some thoughts on the DX of using Teal, Cyan, LuaRocks, etc.
Good stuff
Wishlist
(1) The build tooling around Teal feels a bit disjointed when compared to things like Cargo, NPM, or Gradle. Those tools all build, test, and publish libraries. But with a Teal library, I found myself using Cyan+tlconfig.lua (to get the LSP to detect Teal), luarocks to install test and build dependencies, luarocks to publish the package, and Make to bundle all the commands up. I guess my hope is that Cyan will somehow orchestrate all of this and provide the same kind of all in one experience lots of other build tools and package managers offer. For example, to run the tests or a build, I want a tool that makes sure my dependencies are up to date with my LuaRocks file and then runs the right script. LuaRocks can partially do this, but it doesn't allow for multi-step builds without building a completely custom build command.
(2) Better
any
type integration with generics. If something takes aFoo<any>
and I give it aFoo<T>
, it should work.(3) I didn't dig in yet to figure out how I could easily write my busted tests in Teal, but that would be a great How-To article somewhere.
(4) There are a few other rough edges I ran into around recursive and/or "self" generics that I'll open issues for.
All in all, the "next" branch release of Teal feels really great and I'm hoping to open source a few other libraries for it soon.
Beta Was this translation helpful? Give feedback.
All reactions