Closed komasoftware closed 8 years ago
I can verify the same compilation errors. I did the following steps in an empty test directory.
bower install paper-elements
gwt-api-generator --pom
mvn package
Could you @manolo take a look at this?
Yes, the basic sample from the README does not work anymore :
$ gwt-api-generator --package=PolymerElements/paper-elements --pom $ mvn package
returns the same errors. I'd love to help to get this fixed if @manolo could provide some pointers ?
It's a Polymer comment change in paper-button.html (line 174) that causes this issue:
before:
@param {{node: Object}} detail Contains the animated node.
now:
Event param: {{node: Object}} detail Contains the animated node.
It seems that the missing @param
annotation causes the extension of the TransitionendEvent
to TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event
Can we be a bit more forgiving for this kind of errors in the comments when generating ? @muelbr can you past a link to the relevant part of the generator code ?
I am not committer to this project. But if you are going for the latest polymer version then download the components manually with bower, fix this line and generate the wrapper classes.
$ bower install --save PolymerElements/paper-elements $ gwt-api-generator
As a note, the Polymer team changed from @param
to Event param
due to compiler issues:
https://github.com/PolymerElements/paper-button/commit/2f44db5170fb09d213c1dc87f0859770fe510658
Basically, I think the "name" function (at least for events) needs to take newlines into account.
It doesn't make sense that an event name would span multiple lines.
@komasoftware Using a split on newlines and taking the first line seems to fix the issue.
(Granted, the event's generated NAME string still has the long comment nonsense with only this change in camelCase
, so probably making the same change with other functions)
camelCase: function(s) {
return (s.split('\n')[0] || '').replace(/^Polymer\./, '').replace(/[^\-\w\.]/g,'').replace(/(\b|-|\.)\w/g, function (m) {
return m.toUpperCase().replace(/[-\.]/g, '');
});
},
Back here. The change did not really solve the issue.
Wondering if @manolo still plans to support this library. Otherwise I need to look into another solution and rewrite my code. I would really like to know !
I used an awful solution. The solution of helpers.js line 61 dind't work for me, so i changed it to
camelCase: function(s) {
if (s.toLowerCase().startsWith('transitionend')){
console.log('name--:' + s);
return 'Transitionend';
}
return (s || '').replace(/^Polymer\./, '').replace(/[^\-\w\.]/g,'').replace(/(\b|-|\.)\w/g, function (m) {
return m.toUpperCase().replace(/[-\.]/g, '');
});
}
It's horrible, but it compiles. Then i had to use the fix mentioned here.
The problem I have now is that in Chrome the PaperInput does not work. It is visible, but i can't get the focus. Anyone with the same problem? Could it have to do with the change i made in the function camelCase?
For what i could see, the compilation now is showing a lot of errors/warnings (?) like this one but with many components
Behavior Polymer.Templatizer not found when mixing properties into vaadin-infinite-scroller!
Any idea why this could be? Could this be the problem?
Fixed in ecb419c8c3264bab7e93c54ac7f6c6792bc4a1e6
How can I "npm install -g vaadin/gwt-api-generator" a specific commit ecb419c ? Or will a new release soon follow ?
Thx for all the work !
I installed following Polymer components
"dependencies": { "google-drive": "GoogleWebcomponents/google-drive#^1.0.1", "google-apis": "GoogleWebcomponents/google-apis#^1.1.5", "google-signin": "GoogleWebcomponents/google-signin#^1.3.3", "vaadin-grid": "vaadin/vaadin-grid#1.0.0", "vaadin-combo-box": "vaadin/vaadin-combo-box#1.0.0", "paper-elements": "PolymerElements/paper-elements#^1.0.7", "iron-elements": "PolymerElements/iron-elements#^1.0.10", "neon-elements": "PolymerElements/neon-elements#^1.0.0", "vaadin-icons": "vaadin/vaadin-icons#1.0.0" }
bunch of errors ...