fbonetti / elm-rails Goto Github PK
View Code? Open in Web Editor NEWView helpers for incorporating Elm modules into Rails views
License: MIT License
View helpers for incorporating Elm modules into Rails views
License: MIT License
Hi!
The example in the README gives me the following error when using ELM 0.17.1:
-- SYNTAX PROBLEM ------------------------------------- app/assets/elm/Hello.elm
I ran into something unexpected when parsing your code!
1| module Hello where
^
I am looking for one of the following things:
something like `exposing (..)` which replaced `where` in 0.17
whitespace
Since this is my very first attempt at ELM, the first example I encounter should work with the current stable version 😄 . If a PR is desired, I can do it.
First of all, it's awesome that you've written all this 👍 Unfortunately having to disable asset caching (?) in the development environment makes this almost unusable as I'm working on an app that has a lot of assets and recompiling them on every request takes upwards of 10 seconds.
Do you think that it's maybe possible to change the underlying implementation to not require me to do this? I've had a quick look at the sass-rails code and it does it differently by registering the file extensions and how to transform them. I don't know enough about Elm yet to know if that would be a feasible approach as well or not.
I'd be willing to help with this of course!
I'm probably doing something wrong, but I can't get elm-make to find all of my modules when going through the asset pipeline. (It works in a repl, so I'm not sure what's going one.)
I have a directory structure like:
app/assets/elm
app/assets/elm/Models
app/assets/elm/Api
where my main module (in app/assets/elm) imports modules from the other directories, and modules in Models
also depend on a module in Api
. I added require
lines to my app/assets/javascripts/application.js, but when elm-make tries to compile a module in Models that depends on one in Api, it can't find it.
Originally my elm-package.json (in the root of the rails project) just had "." in source-directories, so I tried adding "Api" and "Models," but that didn't help.
@fbonetti maybe you can clarify this for me. The current example in the README has a port with a value that's passed in as a "flag". If we want interop with a JavaScript library, we need to have access to the JavaScript variable referencing the Elm application. In my app I've solved this by ignoring the view helpers and just embedding my Elm app using the JS API directly. Is there a way to do this with the view helpers?
If not, I'd suggest we could deprecate the view helpers and update the README with an example using straight JS to manage the embed.
It might be nice to have rails generate elm-rails:install
which would create a skeleton Elm app, require
it in application.js
, update the .gitignore
, etc.
Hello !
I'm trying to use elm-rails to render elm on a rails server using turbolinks. However, turbolinks badly handle elm-embed tags. On first load, the javascript is correctly loaded, but if I load the page through turbolinks, the javascript is not executed (and it's rather bad because all HTML is written in Elm).
Any idea to fix this ?
I tried to follow your instruction and when you talk about the app/assets/javascript.js
file do you mean app/assets/javascript/application.js
file?
@fbonetti @lsimoneau I would like to release elm-rails v0.2.2, but I don't have the permissions. Can one of you add me to the rubygems owner's list?
gem owner elm-rails --add [email protected]
Hi there, I appreciate Elm 0.18 is just out today, but I was wondering if you have any plans of supporting it?
Here's the snippet we've been using for our Sprockets integration at NoRedInk—it includes dependency tracking, so it will recompile the assets if any dependent file changes.
Hope it helps!
Slight nitpick, you need to "require" elm_modules in application.js
Just need to edit the documenation from
//= elm_modules
to ->
//= require elm_modules
Thanks for the gem!
Hi.
I wrote a small elm component for my rails app. And it uses
import Bootstrap.Grid exposing (..)
import Bootstrap.Wells exposing (..)
I did elm package install JeremyBellows/elm-bootstrapify
and it is in elm-package.json
But from Rails I get exception:
I cannot find module 'Bootstrap.Grid'.
Module 'PriceCalculator' is trying to import it.
Potential problems could be:
* Misspelled the module name
* Need to add a source directory or new dependency to elm-package.json
Am I wrong? Or JeremyBellows? Or it is something here?
The readme.md file does not tell where the elm package install
command should be run. Is it at the root of the app or in the app/assets/elm
directory?
The elm debugger is actually a great help when dealing with business users submitting bug reports. It was easy to re-train my stakeholders to export their session from my staging environment and attach it to their bugs.
I had forked @lsimoneau 's dependencies fix before you merged it, but I'll go ahead and fork this original repo so that I can submit a pr.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.