Hi !
We interopt with Javascript quite a bit for several reason where the biggest being that our application uses Google Maps quite a lot.
using ports is really nice actually it is a good mix of control and strictness.
Here are all our ports actually.
```
— OUTGOING
port selectInputText : String -> Cmd msg
port eventListChanged : ELT.Model -> Cmd msg
port refreshPage : () -> Cmd msg
port initLocationSearchbox : Bool -> Cmd msg
port initDatepicker : ( Int, Int ) -> Cmd msg
port changeLocation : String -> Cmd msg
port removeThisWhenThatExists : ( String, String ) -> Cmd msg
port focusWhenExists : String -> Cmd msg
port toaster : { text : String, url : String, icon : String } -> Cmd msg
port scroll : String -> Cmd msg
port scrollToEnd : String -> Cmd msg
port locationInputFieldCreated : () -> Cmd msg
port initLazy : String -> Cmd msg
port initGeoplacing : () -> Cmd msg
port confirmGeoplacing : Bool -> Cmd msg
port updateMaterializeTextarea : { text : String, textareaId : String } -> Cmd msg
port updateTitleNotifications : Int -> Cmd msg
— INCOMING
port markerClicked : (String -> msg) -> Sub msg
port worldMapCreated : ({} -> msg) -> Sub msg
port worldMapBoundsChanged : (WorldMap.Types.Model -> msg) -> Sub msg
port pickPlace : (Json.Decode.Value -> msg) -> Sub msg
port eventStartDateChosen : (Int -> msg) -> Sub msg
port eventEndDateChosen : (Int -> msg) -> Sub msg
```
We also use http://materializecss.com/ and it has been a hassle from time to time that its jQuery stuff wants to come in and mess with our stuff but mostly it has worked well. Its the date picker that has given us the most headache.
We also made a media-component that switches between a image and a iframe on hover. That is made with jQuery.
Many things that we wanted from materialize we just ported the things we needed to Elm by looking at the source code.
Elm has more DOM helpers now than when we started so we could actually do more of that stuff in Elm. It has been a learning experience and now we are more comfortable working with elm we feel we can do more and more stuff there. Will be releasing http://t4t5.github.io/sweetalert/ for elm at some point :)
When it comes to the type of optimizing you are talking about we have done zero. Are you also having a SPA ? splinting up JS sounds more like multipage app.
Cheers!