There are two approaches to interacting with JS: 1. ports 2. Native modules with ports cannot be packaged/published and are designed to be used ONLY in the final product modules with Native code can be packaged/published but they have to be whitelisted. Their use is discouraged outside of the web-platform that the official elm-lang org is implementing.
elm-github-install is designed for the brave rebels who want to collaborate on non-whitelisted Native modules. To my knowledge, port modules were never designed to be shared. On Fri, Nov 18, 2016 at 12:53 PM, 'Rupert Smith' via Elm Discuss < [email protected]> wrote: > https://github.com/gdotdesign/elm-github-install > > One of the reasons for this existing is to be able to share native modules > outside of the official packages. My Auth code uses ports, I extracted it > into a github project here: > > https://github.com/rupertlssmith/elm-auth > > Then referenced it in my elm-package.json: > > "rupertlssmith/elm-auth" : "0.0.1 <= v < 1.0.0", > > I run elm-github-install, and it downloads into elm-stuff just fine. > > However, when I then run elm-make it complains: > > "You are trying to publish `port module Auth` which > is defined in: elm-stuff/packages/rupertlssmith/elm-auth/0.0.1/ > src/Auth.elm > > Modules with ports cannot be published..." > > But I am not trying to publish it, just build it. Its also strange, > because this Auth code was part of this projects source code before I > lifted it out into a separate project. So elm-make will build the code with > ports from source just fine, but not build it when the ports are in a > dependency module. > > Am I overlooking something? Seems like elm-github-install does not make it > possible to re-use native modules after all. > > -- > You received this message because you are subscribed to the Google Groups > "Elm Discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- There is NO FATE, we are the creators. blog: http://damoc.ro/ -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
