notwaldorf / ama

:raising_hand: Ask @notwaldorf anything!
94 stars 13 forks source link

Mojibrag Status #61

Closed matthewpull closed 7 years ago

matthewpull commented 7 years ago

Hi Monica,

I'm a huge fan of Polymer and was very fortunate to attend the conference in London last October - it was my first ever developer conference (I'm 19) and it was an amazing experience. The Polymer team do a fantastic job in making both the core framework and the multitude of components, the documentation for which is some of the most useful I've seen in a long time. However, I am currently having an issue with app-indexeddb-mirror. I can't get it to pull data from IndexedDB when offline (works fine online), even though I have verified that data is present in IndexedDB using DevTools. This is not a request for help, but I notice that mojibrag also uses app-indexeddb-mirror, and it works fine. I am looking through your code to compare it with my own but, so that I can eliminate these as being potential issues, can you please answer the following questions:

1) Did you build your application using the standard 'polymer build' command from the cli and, if so, did you deploy the build/bundled folder? (I believe that this is true given your firebase.json, but I want to be sure)

2) Did you have to include any files to get app-indexeddb-mirror to work, outside of adding the two JS files to polymer.json's includeDependencies?

Many thanks for your time and please pass on my warm regards to the rest of the Polymer team.

Have a great day!

--Matthew Pull

matthewpull commented 7 years ago

Nevermind, I have managed to get it working by setting the variable bound to app-indexeddb-mirror's 'data' property to '[]' when the page is ready.

<app-indexeddb-mirror
    key="recipes"
    data="[[recipeListLive]]"
    persisted-data="{{recipeList}}">
</app-indexeddb-mirror>
ready: function () {
  this.recipeListLive = [];
},

Looking through mojibrag's code helped SO much with finding this fix. Thank you so much for creating it (and open-sourcing it)!

Sorry for bothering you, have a great day!

--Matthew Pull

notwaldorf commented 7 years ago

Hiya! Glad you fixed it, and super glad mojibrag is useful! To answer your first question, yeah, I deployed the bundled version. From the terminal logs, I think the exact command I run to build and deploy is:

polymer build && firebase deploy --only hosting

🎉

matthewpull commented 7 years ago

Thanks, that's helpful 😄