Giter Site home page Giter Site logo

polymer's People

Contributors

abiosoft avatar benjamin-rood avatar dmitshur avatar emmaly avatar skritchz avatar stanim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

polymer's Issues

code.palmstonegames.com SSL cert is expired

The code.palmstonegames.com SSL cert is expired, which is causing go get for this package to fail.

user@e2c5a1e9cd1a:~$ go get -u -v code.palmstonegames.com/polymer
Fetching https://code.palmstonegames.com/polymer?go-get=1
https fetch failed: Get https://code.palmstonegames.com/polymer?go-get=1: x509: certificate has expired or is not yet valid
package code.palmstonegames.com/polymer: unrecognized import path "code.palmstonegames.com/polymer" (https fetch: Get https://code.palmstonegames.com/polymer?go-get=1: x509: certificate has expired or is not yet valid)

TagNames should contain a dash

If a TagName doesn't contain a dash ( - ), then Polymer will panic. Polymer however does not mention that this is why it panics.

Slice handling is very clunky

Due to a combination of multiple factors, working with slices of primitives is very very clunky right now. A pass should be done to try and make things easier to work with.

Related polymer issue: Polymer/polymer#1913

Events not found

I am not sure if this is a bug, if I am doing something wrong or what. In my changes to one of the examples below, I am trying to trigger an event when the submit button is clicked. However, I get the following error:

Uncaught ReferenceError: handleSubmitClick is not defined 
diff --git a/examples/databind-event-callback/main.go b/examples/databind-event-callback/main.go
index f9fb5aa..d9b7133 100644
--- a/examples/databind-event-callback/main.go
+++ b/examples/databind-event-callback/main.go
@@ -34,4 +34,10 @@ func (n *NameTag) HandleNameChange(e *polymer.Event) {
        })
 }

+func (n *NameTag) HandleSubmitClick(e *polymer.Event) {
+       polymer.Async(1, func() {
+               polymer.Log("Submit clicked")
+       })
+}
+
 func main() {}
diff --git a/examples/databind-event-callback/name-tag.html b/examples/databind-event-callback/name-tag.html
index 2ec151b..ce36d90 100644
--- a/examples/databind-event-callback/name-tag.html
+++ b/examples/databind-event-callback/name-tag.html
@@ -15,6 +15,7 @@
                The go code bound to it will output the name to the console using fmt.Printf. See main.go.<br />
                Each name-tag element is also completely independent, backed by a different instance of the NameTag structure<br />
                The Go generated ID of this particular name tag is <b>{{id}}</b>
+               Name: <input type="submit"  onclick="handleSubmitClick" /><br />
        </template>
        <script>PolymerGo("name-tag")</script>
-</dom-module>
\ No newline at end of file
+</dom-module>

I get the same error when I try to use a property change event like this:

<child-component timer-value="{{timerValue}}" on-timer-value-changed="handleTimerValueChanged"></child-component>

However, if I do this in the Created function, it works:

func (c *ChildComponent) Created() {
                c.This().Call("addEventListener", "timer-value-changed", c.HandleTimerValueChanged)
}

Notify() error in examples

The databind-struct example raises this error, below. Similar errors are raised in the notify and computed-property examples. The other examples run just fine, even though they also use Notify(), and I haven't figured out why.

Uncaught TypeError: Cannot read property 'testStruct' of undefined
    at HTMLElement._propertySetter (polymer.html:formatted:1405)
    at HTMLElement.setter (polymer.html:formatted:1495)
    at HTMLElement.set (polymer.html:formatted:2154)
    at Object.$packages.github.com/PalmStoneGames/polymer.BY.ptr.doNotify (proto.go:87)
    at Object.$packages.github.com/PalmStoneGames/polymer.BY.ptr.Notify (proto.go:82)
    at $b (main.go:30)
    at $goroutine (databind-struct.js:4)
    at $runScheduled (databind-struct.js:4)
    at $schedule (databind-struct.js:4)
    at $go (databind-struct.js:4)
    at Object.$packages.github.com/PalmStoneGames/polymer/examples/databind-struct.D.ptr.Created (main.go:24)
    at $b (callbacks.go:62)
    at HTMLElement.created (databind-struct.js:4)
    at HTMLElement.__initialize (polymer-micro.html:232)
    at HTMLElement.createdCallback (polymer-micro.html:217)
    at window.Polymer (polymer-micro.html:62)
    at CN (register.go:240)
    at CM (register.go:202)
    at v.$externalizeWrapper (databind-struct.js:4)
    at webcomponents-lite.min.js:12

My versions:

  • go version go1.8.3 linux/amd64
  • bower 1.8.0
  • nodejs v6.10.3
  • GopherJS 1.8-2 (commit 7cde3d36aea3e1b3be7827c4dcbe6bbae73d012e)

Notify() should take multiple arguments

It would be nice if we could pass a slice of strings to Notify() , so we could just pass along a collection of them to update at the end of each function.

Remove unused regexp import to reduce generated js by ~25%

The regexp package in js.go isn't being used. by removing it, I reduced my generated js code by about 25 percent. As a side note, if you refactor out the fmt package, you can reduce it by an extra 15% or so.

Before:
gopherjs build:  1944768
gopherjs build -m:  1323920
gopherjs build -m gzipped:  250851

After:
gopherjs build:  1455297 -25.2%
gopherjs build -m:  1003977 -24.2%
gopherjs build -m gzipped:  187357  -25.3%
diff --git a/js.go b/js.go
index dfc727d..03f5c6f 100644
--- a/js.go
+++ b/js.go
@@ -18,23 +18,12 @@ package polymer

 import (
    "reflect"
-   "regexp"
    "time"
    "unicode"

    "github.com/gopherjs/gopherjs/js"
 )

-var propertyEventNameRegExp *regexp.Regexp
-
-func init() {
-   var err error
-   propertyEventNameRegExp, err = regexp.Compile("([a-z])([A-Z])")
-   if err != nil {
-       panic(err)
-   }
-}
-
 const DateTimeLocalFormat = "2006-01-02T15:04:05"

 // DateTimeLocal is a time.Time that properly encodes and decodes to the format expected datetime-local input fields

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.