Published on January 4, 2017 by Chrome

It’s time to wrap up our series on Firebase and Polymer. In today’s episode we’ll look at how you can use the polymer-build library to craft a Gulpfile to bundle your Polymer and Firebase resources for production. polymer-build is a really helpful little resource that will take your HTML Imports and split them into individual streams for your CSS, HTML, and JavaScript. You can then pipe these streams to individual gulp tasks to do minification, etc. then use polymer-build to recombine the streams and output the final product.

Sample Code: github.com/Polymer/polycasts/tree/master/ep60-firebase-build

polymer-build: github.com/Polymer/polymer-build

Polycasts playlist: goo.gl/r5fsMq
Polymer Slack: bit.ly/polymerslack
Polymer G+: plus.google.com/communities/115626364525706131031

Subscribe to the Chrome Developers channel: goo.gl/OUF4e2

Leave a Reply

28 Comments on "Building Firebase for production — Polycasts #60"

Notify of
avatar

natebarnz
Guest
natebarnz
2 days 2 hours ago

I am getting this error when running "npm run build". Anyone know why?

[22:49:51] Starting 'default'…
Deleting build/ directory…
Analyzing build dependencies…
error: In public/bower_components/polymer/lib/legacy/polymer-fn.html: [could-not-load] – Unable to load import: Cannot read property 'forEach' of undefined
(node:44730) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: 1 error(s) occurred during build.
[22:49:54] The following tasks did not complete: default
[22:49:54] Did you forget to signal async completion?

Michael Fons
Guest
Michael Fons
1 month 10 days ago

this does not seem to readily work against polymer 2; wondering if anybody else is working on getting this working?

Filip Göranson
Guest
Filip Göranson
2 months 17 days ago

I used the code in the description but the process fails. Whats wrong?Starting 'default'…Deleting build/ directory…Analyzing build dependencies…The following tasks did not complete: defaultDid you forget to signal async completion?

Michael Fons
Guest
Michael Fons
1 month 10 days ago
I got something like that too…my error a bit higher in the log said it could not find webcomponent-min.js or something. There is a version of this without the "-min" in approximately where it was looking but since I was trying to do this video exercise against polymer2 I was assuming that file may have been replaced with something. This is why I am was asking around.If I can get this working then there that gives me an entree into polymer 2 for my app, since the process of doing the migration is overwhelming my mind at the moment, as… Read more »
Srikanth Gatta
Guest
Srikanth Gatta
2 months 27 days ago

#AskPolymer I watched Arrays/Objects data biding many times but somehow still not getting it right. But now with Firebase it seems its more unclear why its working sometimes and not othertimes.For ex: when I create a <firebase-document … data={{myData}}> and insome <paper-input value={{myData.text}}/>, anytime I change the text in input filed it AUTOMATICALLY stores directly inside firebase database. But When try the same in javascript function for someother property, say myData.title = newTitle, this is not saved in Firebase database. Can someone point me to good examples of array,object bindings that work with Firebase+Polymer.

John-Paul Ensign
Guest
John-Paul Ensign
3 months 2 days ago

#AskPolymer Can the order of the videos in the Playlist be corrected? They are currently backwards so autoplay goes the wrong way. To go "forward" in Polycasts, you need to press Previous two times (once only will restart the current video).

Michael Fons
Guest
Michael Fons
1 month 10 days ago

Actually I kind of like that it plays backward 🙂 Then it is kind of like watching the movie Momento lol. Actually though, I truly feel that the best learning happens when you are drinking from a firehose, and then learning the details as you trip up and go investigating.

Alex Goodwin
Guest
Alex Goodwin
3 months 25 days ago

Awesome!

JoséAntonio Campillo
Guest
JoséAntonio Campillo
4 months 19 hours ago

Why can't i vulcanize for polyfire app?? thanks so much

pullModel
Guest
pullModel
4 months 3 days ago

If I am keeping my facts straight, then Firebase now supports HTTP 2 which I believe that I have read is better with unbundled builds than bundled? But this polycast is about how to bundle? Am I getting one of my facts wrong?

Ashwin Ashok
Guest
Ashwin Ashok
4 months 7 days ago

Rob, ever considered modelling? nice tutorial though.

phani1 kumar
Guest
phani1 kumar
4 months 18 days ago

Thank you very uch Rob for the polycasts. #AskPolymer Can you please come with a polycast for localization using app-localize behavior? I've a very specific question here: can I dynamically load language specific resource bundles when the user changes the language of preference? I don't want to load all the translations at once, because if the user is interested in French, I don't want to download all other language variants of all my messages. This would hit badly on performance/ bandwidth. Thanks in advance.

Michael Fons
Guest
Michael Fons
1 month 10 days ago

Yes, Thank you very much Rob!! once again…

wpDiscuz