Pdamoc:
In my experience - the quality level of javascript packages varies vastly - and not all of it depends on years experience - much of it depends on the principles and practices of the library author - testing, clear interfaces, and careful responsibility segregation without over doing things is easier with experience - but even a rough attempt that follows those kinds of principles is a league ahead of most javascript today.
Sometimes the simplest solution is the best and while it can be attractive to modify the core to support things that appear to be “simple” it’s not alway really actually simple to do so.
For instance in the link you mention: https://github.com/elm-lang/elm-compiler/issues/1450 - the last post mentions using a single Ports.elm - it would give a developer a single point of change and management for the Elm application - thats seems nice - straightforward (after some effort is applied to get the ports subscriber concept down) - and some tradeoffs are accepted.
I think it’s nice to have libraries - but even more so it is good to have code that will not throw a runtime error - this is something truly radical that elm gives. If you need javascript and elm together in your app - you are probably the best person to understand that context - Yes it means learning about subscriptions - and yes it will mean managing concurrency issues that can be created with this kind of event model (too many events, not enough, race events etc) - honestly that kind of thing happens in javascript all the time - Elm is better and ports and elm is better than just javascript – and that’s what we have for now.
I think perhaps for now - a good way to use elm at the moment - is to think of it as a place to put the essence of your application - core logic - and then perhaps integrate a bunch of scrappy subject-to-change javascript around it. That’s where my head is at with javascript - mostly because I work with a team of developers who know javascript well and it works for them - in order it bring elm in I really need to be focused and make it’s power work in a way that makes it worth the extra rigor it brings.
Ports is a good way to get comfortable with the publish subscribe pattern - It may not be ideal - but it is effective - and ultimately since so much of software is making careful, mindful trade-offs I think “good enough” is a great starting place for many things.