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

using sink.appendToBody breaks fastrender

Open macrozone opened this issue 7 years ago • 1 comments

reproduction:

FastRender.onPageLoad(async sink => {
    sink.appendToBody('<p>test</p>');
})

will result in [object Object]<p>test</p> instead of <script type="text/inject-data">%7B%22fast-render-data....><p>test</p>

The problem is probably in inject-data

macrozone avatar Oct 14 '18 13:10 macrozone

workaround:

import { InjectData } from 'meteor/staringatlights:inject-data';

InjectData.disableInjection = true;

FastRender.onPageLoad(async sink => {
... 

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


macrozone avatar Oct 14 '18 13:10 macrozone