polymer 0.9 migration

115 views
Skip to first unread message

ma...@timtwillis.com

unread,
May 16, 2015, 9:03:42 AM5/16/15
to polym...@googlegroups.com
i have several large projects that I would like to start moving from 5.x to .9 and on to 1. 

I like where the project is going, but really this has been a HUGE PAIN to migrate. I have started, but wonder if I should continue without further questions being answered:

1) Compound binding/string interpolation in bindings:  - if this is still being developed and a estimated time line

2) Exploring helpers for binding to class and style.:  - if this is still being developed and a estimated time line
3) template if binding with simple == < > comparisons: - if this is still being developed and a estimated time line




reasons:


the lake of this <div>Dear {{ title }} {{ lastName }},</div> is huge, it's everywhere in my code.

something like this:

        <!--<iron-ajax url="/api/international-affiliations/Affiliation-count/{{new_tenant_id}}/{{selectedPlaceId}}/"
                   handleas="json" auto
                   on-response="affiliationsResponse"
                   on-core-error="{{ajaxError}}"
                   id="ajax_degrees">
        </iron-ajax>

turns into  url="[[ajax_activities_url]]"

        ajax_degrees_url_init: { type: String, value: "/api/summary/degree-count/0}/1/2/" },
        ajax_degrees_url_params: {
            computed: 'compute_url_object(new_tenant_id, selectedPlaceId, selectedEstablishmentId)'
        },
        ajax_degrees_url: {
            computed: 'compute_url(ajax_degrees_url_init,ajax_degrees_url_params)',
        },

    compute_url_object: function (...args: any[]) {
        return arguments;
    },
    compute_url: function (str, mapObj) {
        var re = new RegExp(Object.keys(mapObj).join("|"), "gi");

        return str.replace(re, function (matched) {
            return mapObj[matched.toLowerCase()];
        });
    },



I don't want to make a new property to like y =  x > 1, I just want to declare that in my template, it's everywhere...

I was using the core-style, it was an easy way for me to make my multitenant site have tenant specific themes.


I stuck with polymer over something like riot/react because it was just so simple and composable, without these features I am wondering if I made the right decision. 

I would appreciate anyone who can provide me with the 3 answers above.

thanks
Tim 

ma...@timtwillis.com

unread,
May 16, 2015, 10:30:48 AM5/16/15
to polym...@googlegroups.com, ma...@timtwillis.com
I'm not sure if the following is possible with a "computed" and a dom-repeat template. I was binding with child and parent properties prior to .9/.8 

<template is="dom-repeat" as="agreementTypeCount" index-as="agreementTypeCountI" items="{{agreementTypeCounts}}">
      <a href="/{{style_domain}}/agreements/#/table/country/{{selectedCountryCode}}/type/{{agreementTypeCount.type}}/sort/start-desc/size/10/page/1/">{{agreementTypeCount.type}}</a>
</template>
Reply all
Reply to author
Forward
0 new messages