Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polymer 3, lit-element & polymer-redux #129

Open
ZempTime opened this issue Apr 21, 2018 · 2 comments
Open

Polymer 3, lit-element & polymer-redux #129

ZempTime opened this issue Apr 21, 2018 · 2 comments

Comments

@ZempTime
Copy link

Hello!

I'm running into an issue where I get:

Uncaught TypeError: element._setPendingPropertyOrPath is not a function
    at bindings.forEach.name (polymer-redux.js:64)
    at Array.forEach (<anonymous>)
    at update (polymer-redux.js:57)
    at bind (polymer-redux.js:83)
    at HTMLElement.connectedCallback (polymer-redux.js:151)
    at render (lit-html.js:151)
    at HTMLElement._propertiesChanged (lit-element.js:134)
    at HTMLElement._flushProperties (properties-changed.js:342)
    at HTMLElement.ready (properties-changed.js:165)
    at HTMLElement.ready (lit-element.js:89)

When I locally hopped in there and changed _setPendingPropertyOrPath to _setPendingProperty (they had similar looking method signatures), it stopped failing/actions worked, but no properties were ever populated from the store.

To reproduce,

If I'm able to figure out what's going wrong, I will come back and update!

@ZempTime
Copy link
Author

It appears lit-element doesn’t pull in @polymer/polymer/lib/mixins/property-effects.js, it only pulls in @polymer/lib/mixins/properties-mixin.js'.

Gonna attempt a switch to lit-html and see if I can make any headway...

@ZempTime
Copy link
Author

I ended up needing to basically yank out the polymer-redux bit and rewrite portions of it. results here: https://github.com/ZempTime/marsfarm-ui/blob/master/src/mixins/marsfarm-polymer-redux.js

Additionally, because I stopped using the production dist of redux, had to add this to the bottom of my index.html file:

  <script>
    // TODO: Use production redux bundle (either dist or uglified) later.
    // Will either need to integrate loose-envify into build process or
    // figure out some other way.
    window.process = window.process || {};
    process.env = process.env || {};
    process.env.NODE_ENV = "development";
  </script>

I also think I'll drop the domainConceptMixin (instead of directly using ReduxMixin approach) for a little while and see about that. I ran into issues where I'd accidentally override properties and not realize that was what was causing everything to go crazy.

Specifically, it's impossible to tell what results in the object you're looking at in this line: https://github.com/ZempTime/marsfarm-ui/blob/master/src/mixins/marsfarm-polymer-redux.js#L50 so I think direct is better. If reusability becomes too big a pain I might swap back, though. Being able to get warnings when I override existing properties would be sweet, but that's a js thing.

I'm not sure what to do with this issue/comment, but if you'd like to expand support to people who're gonna be using LitElement then I'd be happy to help!

@ZempTime ZempTime changed the title Polymer 3: element._setPendingPropertyOrPath is not a function Polymer 3, lit-element & polymer-redux Apr 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant