-
Notifications
You must be signed in to change notification settings - Fork 28
How to properly resolve assets path? #8
Comments
BTW, I've written an article in Brazilian Portuguese (http://www.akitaonrails.com/2014/06/29/usando-polymer-com-rails#.U7CKzhbY-zA). The last section tries to show how I would add bower-rails to the mix. And the code for the demo is in my public Github account: https://github.com/akitaonrails/polymer-test. It's failing to deploy to Heroku. If anyone can check it out, that would be great. |
I just made some updated to my github public demo. bower-rails actually works and the bower:resolve task didn't solve what I wanted. The Polymer/core-icon-button can't show it's image icons when deployed in production but it depends on Polymer/core-icons, and this one renders the icons using inline SVG, so I don't know why the icons don't show up. Probably another relative path issue between components somehow. |
First of all, thanks for writing that blog post about Emcee and using Polymer with Rails! I never thought that something I made would be written about, and it's really cool to see it out there. |
Sure, it's a nice project. If we can only figure out how to properly handle the component's assets that would be great. have you tried to integrate the polymer/vulcanize into the pipeline? |
I have been able to use Polymer with this. I have not used Vulcanize with it, though. This project is really the same thing as Vulcanize for use with Rails. It's really a competitor for Vulcanize and I'm not sure how this could be integrated with it. To be honest, I'm a little bit slow and I don't quite understand the issue. Do you have a repository that illustrates the problem, or could you give me more detail? Thanks! |
Yeah, sorry, you mentioned that before. Could you take a look at my demo: https://github.com/akitaonrails/polymer-test ? It works in development. See that the search icon shows up in development but doesn't when I deploy in production (Heroku, for example). Any ideas? |
Ok, I understand now: the repo works correctly in development, but not when deployed to Heroku. I've forked your repo, and I'll see if I can get it to work. Off the top of my head, I don't think bower-rails is necessary to get it to work. |
@akitaonrails I haven't done any testing for this issue, yet, but I'm wondering if the fix for issue #11 has solved this. Can you see if it works for you, now? The master branch is updated with the fix. Thanks. If it doesn't work, I'll dig into it some more. |
Nevermind, I think I found the issue. This line is in core-iconset-svg: var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); The HTML compressor attempts to remove javascript comments such as this: This is stripping out everything after var svg = document.createElementNS('http: This is a syntax error, and the web components don't load right. I'll work on a fix for this. |
Looks like I've fixed it. Check it out here (for the time being). I also re-wrote some of the test app because it doesn't need bower-rails. You can see that repo here. I can also submit a pull request, if you want it. To convert it, I got rid of all the node stuff, removed the |
Ah, nice, please do send me the PR, I'll update my demo and my post to reflect this. And I agree, bower-rails can be removed. |
Never mind, already added your fork as a remote and pulled to mine :-) |
Cool! I did not know you could do that. Thanks again for raising the issue. |
The way it's built today it seems like the application.html will concatenate all the components dependencies, but it will not resolve the relative asset paths to proper #asset_path. I was wondering if adding bower-rails and trying the bower:resolve task would solve it. Or even using Polymer's own Vulcanize somehow.
Did you solve this already?
The text was updated successfully, but these errors were encountered: