Comments (27)
I am not really sure what the problem is. The Polymer code seems to work on other sites. There is some issue where wither the framework or Rails gets confused and cannot seem to execute the polymer templates properly.
from emcee.
Thanks for bringing up the issue! I have used Polymer, Rails, and Emcee together successfully. I have had several issues come up specifically with core-icons, though.
I'll see if I can figure out what the problem is.
from emcee.
@ahuth I thought is was the Polymer code at first, but it seems to work on other sites. It is a really strange issue.
from emcee.
Hi. I had simmilar issue yesterday and the problem comes with nokogiri's html escaping. It escapes some attributes, src for example, and ruins '{{' and '}}' symbols. I can't find nokigiri's option which can turn off the escaping and I think the better way is unescaping the symbols back in 'process' method of each processors.
from emcee.
@rastyagaev I am unfamiliar with nokogiri's purpose is. It seems to be dependent gem in Rails though. Does the gem provide a way to provide how to escape or exclude some character sets/
from emcee.
If you open paper-button and change the following
<core-icon id="icon" src="{{iconSrc}}" icon="{{icon}}"></core-icon>
to
<core-icon id="icon" src="temp" icon="{{icon}}"></core-icon>
(I am calling the element with only the icon attribute set)
you can see it trying to grab the "temp" resource.
I think @rastyagaev is on the right track. The {{iconSrc}}
being escaped to %7B%7BiconSrc%7D%7D
is most likely the problem.
I am just not sure how to attempt to fix the issue.
from emcee.
Try also this: <core-icon id="icon" data-src="{{iconSrc}}" icon="{{icon}}"></core-icon>
.
Does the gem provide a way to provide how to escape or exclude some character sets?
No, it doesn't (as far as I can see). Nokogiri's doc also has the to_xml
method which doesn't escape symbols, but inserts CDATA around js-code. Insertion occurs each time when you run to_xml
in sprokets processors and code looks like this:
<script><![CDATA[<![CDATA[<![CDATA[
Polymer('test-element')
]]]]]]><![CDATA[><![CDATA[>]]]]><![CDATA[>]]></script>
from emcee.
You can use version 0.2. It works for me.
from emcee.
@rastyagaev yeah, not sure where we can go from here. Can we just ignore the sprocket parsing and do it directly in the head for the layout?
version 0.2 of Polymer? I was hoping to use some of the new items in the 0.3.3 for a project.
from emcee.
No. Version 0.2.0 of Emcee.
from emcee.
Downgraded to 0.2.0 and still have the same error .....
I thought it was working, but still giving me the same trouble.
from emcee.
Have you cleaned the rails cache after downgrading?
from emcee.
@rastyagaev I just cleared the cache.
Can you link to code that you have it working with?
I am running into a new error, and could use an example with Polymer.
from emcee.
Sure. https://gist.github.com/rastyagaev/47387ec1664d8dd2e2be
from emcee.
Thanks for the info, guys. I've got a fix-character-escaping branch and added a test for this. If you guys get a chance, can you test this branch out and see if it fixes your issues?
If not, I'll merge it in and go from there.
Right now the fix just substitutes the correct characters back in - for instance, %7B
gets replaced by {
. Pretty low-tech, and I'd like to find something better, but it works.
from emcee.
Yes, it works. Thanks for fix!
from emcee.
No problem. The change has been merged into master, but it's not in a release, yet.
Also, I've changed the fix to use URI.unescape instead of my own custom method. You can see this here. My tests still pass with this, but I don't think I've tested every possible case.
from emcee.
This fix has now made it to release 1.0.2, and it is on rubygems.org.
from emcee.
@ahuth thanks for the work. That seems to have fixed that issue. I am trying to figure out an issue in the paper-shadow component. Some strange JS error. I think it is unrelated to what we were doing here.
from emcee.
@dwa012 Out of curiosity, can you tell me what the JS error is? It's not for an illegal token or for polymer.js not being loaded, is it?
from emcee.
@ahuth The issue is in paper-shadow/paper-shadow.html line 112.
In this block
registerCallback: function(polymerElement) {
var template = polymerElement.querySelector('template');
this._style = template.content.querySelector('style');
this._style.removeAttribute('no-shim');
}
specifically
this._style.removeAttribute('no-shim');
this._style
is null after trying to query the style selector.
I put a guard around it for now, but that causes some rendering issues for the paper-buttons.
I am not sure if it is an import problem or not.
from emcee.
Ok, I'll take a look at it. I haven't used 'paper' elements before, but I definitely want to make sure this isn't an issue with Emcee.
Thanks.
from emcee.
Is this solved for good? Because even on emcee (1.0.7) I have problems with icons...
<core-icon src="%7B%7Bsrc%7D%7D" icon="{{icon}}"></core-icon><content></content>
from emcee.
This was solved for good, although it's become an issue with recent changes. See issues #28 and #29.
My unit tests all still pass, so not sure why this isn't working anymore, but I'll look into it this weekend.
from emcee.
In the meantime, v1.0.6 should work.
from emcee.
It does (I had to delete cache as well)... so thank you...
from emcee.
Solved with v1.0.8.
from emcee.
Related Issues (20)
- Issue Using Erb Templating in HTML Imports HOT 9
- HAML support for html_import_tag HOT 2
- core-icon, core-scaffold not working HOT 9
- Routing Error HOT 4
- Stylesheets linked from polymer elements aren't being precompiled HOT 3
- External stylesheets aren't being reloaded HOT 3
- Getting not valid UTF-8 when using google-map web component HOT 5
- Some paper elements break polymer HOT 7
- Image asset urls HOT 2
- Polymer/Paper path parsing issue. HOT 4
- core-icon-button not working (random src) HOT 3
- Icons within elements (e.g., paper-icon-button) not rendering; think its a pipeline issue HOT 8
- Encoding / Umlauts escaping in JavaScript HOT 4
- Support: Import on custom elements HOT 1
- paper-toast not working in Firefox and Safari HOT 4
- Reloading of stylesheets HOT 2
- core-transition throwing exception HOT 1
- Emcee Railtie cant Modify frozen Array HOT 7
- Using rails + polymer how to root in rails HOT 1
- toastr is not working on safari at mac book pro
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emcee.