meteor-fast-render icon indicating copy to clipboard operation
meteor-fast-render copied to clipboard

When using FastRender.onAllRoutes and FastRender.route, subscriptions with same name are only concidered once

Open macrozone opened this issue 7 years ago • 1 comments

reproduction:

FastRender.onAllRoutes(function() {
   this.subscribe("my-subscription", "a");
})

FastRender.route('/foo', function() {
    this.subscribe("my-subscription", "b");
});

then only my-subscription with param b will end up in the injected data.

EDIT:

acutally, the data is there, but in the injected data you will find only one subscription as done:

"subscriptions": {
      "my-subscription": {
        "[\"b\"]": true
      },
    },

a is missing there

macrozone avatar Oct 14 '18 15:10 macrozone

maybe its somewhat related to https://github.com/abecks/meteor-fast-render/issues/23

but my current workaround in my SSR code:


 FastRender._mergeFrData(
          sink.request,
          FastRender.frContext.get().getData()
        )
        const payload = `<script type="text/inject-data">${InjectData.encode(
          sink.request.headers._injectPayload
        )}</script>`;

macrozone avatar Oct 14 '18 16:10 macrozone