Differential / meteor-vulcanize

Vulcanize html imports in your meteor app.
32 stars 15 forks source link

When VULCANIZE=true, it doesn't load the vulcanized files #26

Closed tjmonsi closed 8 years ago

tjmonsi commented 9 years ago

Hi everyone,

All is fine and dandy when VULCANIZE is unset in my environment variables. But when I tried turning it on for production, something went wrong. Here's the look of the head.html file in the .meteor/local/build/programs/web.browser/ folder after running meteor without VULCANIZE environment variable

<script src="/bower_components/webcomponentsjs/webcomponents.js"></script>
<script> window.Polymer = {dom: "shadow"}; </script>
<link rel="import" href="bower_components/iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="bower_components/paper-header-panel/paper-header-panel.html">
<link rel="import" href="bower_components/paper-toolbar/paper-toolbar.html">
<link rel="import" href="bower_components/iron-icon/iron-icon.html">
<link rel="import" href="bower_components/iron-icons/iron-icons.html">
<link rel="import" href="bower_components/paper-drawer-panel/paper-drawer-panel.html">
<link rel="import" href="bower_components/paper-icon-button/paper-icon-button.html">
<link rel="import" href="bower_components/paper-input/paper-input.html">
<link rel="import" href="bower_components/paper-menu/paper-menu.html">
<link rel="import" href="bower_components/paper-item/paper-item.html">
<link rel="import" href="bower_components/paper-item/paper-icon-item.html">
<link rel="import" href="bower_components/paper-ripple/paper-ripple.html">
<link rel="import" href="bower_components/paper-card/paper-card.html">
<link rel="import" href="bower_components/paper-button/paper-button.html">
<link rel="import" href="bower_components/paper-spinner/paper-spinner.html">
<link rel="import" href="bower_components/paper-toast/paper-toast.html">
<link rel="import" href="bower_components/paper-material/paper-material.html">
<link rel="import" href="bower_components/iron-image/iron-image.html">
<link rel="import" href="bower_components/paper-tooltip/paper-tooltip.html">
<link rel="import" href="bower_components/paper-fab/paper-fab.html">
<link rel="import" href="bower_components/paper-badge/paper-badge.html">
<link rel="import" href="bower_components/paper-input/paper-input.html">
<link rel="import" href="bower_components/paper-input/paper-textarea.html">

But when I run with VULCANIZE, this is only what I see...

<script src="/bower_components/webcomponentsjs/webcomponents.js"></script>
<script> window.Polymer = {dom: "shadow"}; </script>

There's no file that involves loading vulcanize-{md5}.html I would like to know what's wrong? Thanks

tjmonsi commented 9 years ago

After a bit of checking the package out, I found out that if does the compileStep alright but looking at the folders at real time, it seems that the builds are already being deleted way before the compileStep.addAsset for the vulcanized file is done. Thus, all the things are not added inside the html.

I tried it by putting the call addImportTag function, which is the the last line after compileStep.addAsset is done, outside the vulcan.process function. The resulting head.html becomes like this:

<script src="/bower_components/webcomponentsjs/webcomponents.js"></script>
<script> window.Polymer = {dom: "shadow"}; </script>
<link rel="import" href="/vulcanize.html">

But the file is not yet inside the app/ folder inside the web.browser folder. This confirms my haunch that it indeed a race condition

schnie commented 8 years ago

I think you are correct @tjmonsi . I just had a few minutes to mess with it, so I just required futures, and had it wait until the vulcanize callback is run. Looks like it works! Try v3.0.0.

tjmonsi commented 8 years ago

Ohhh nice :) thanks :)

On Sat, 14 Nov 2015 07:46 Greg Neiheisel notifications@github.com wrote:

I think you are correct @tjmonsi https://github.com/tjmonsi . I just had a few minutes to mess with it, so I just required futures, and had it wait until the vulcanize callback is run. Looks like it works! Try v3.0.0.

— Reply to this email directly or view it on GitHub https://github.com/Differential/meteor-vulcanize/issues/26#issuecomment-156592020 .

patriceleva commented 8 years ago

Yes nice, thanks

Le sam. 14 nov. 2015 00:47, Toni-Jan Keith Monserrat < notifications@github.com> a écrit :

Ohhh nice :) thanks :)

On Sat, 14 Nov 2015 07:46 Greg Neiheisel notifications@github.com wrote:

I think you are correct @tjmonsi https://github.com/tjmonsi . I just had a few minutes to mess with it, so I just required futures, and had it wait until the vulcanize callback is run. Looks like it works! Try v3.0.0.

— Reply to this email directly or view it on GitHub < https://github.com/Differential/meteor-vulcanize/issues/26#issuecomment-156592020

.

— Reply to this email directly or view it on GitHub https://github.com/Differential/meteor-vulcanize/issues/26#issuecomment-156592136 .