Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2 SSR computed properties: component _render method does not pass ref object #1349

Closed
btakita opened this issue Apr 17, 2018 · 1 comment
Closed

Comments

@btakita
Copy link
Contributor

btakita commented Apr 17, 2018

Here is some sample generated code. Notice that meta__Layout__SSR(...) does not receive a ref object, but the three dependency props instead.

Page__Company__SSR._render = function (__result, state, options) {
    __result.addComponent(Page__Company__SSR);
    state = Object.assign(options.store._init(["summary__company"]), data$3(), state);
    state.meta__Layout__SSR = meta__Layout__SSR(state.ctx, state.meta, state.company_locator);
    state.styles__Layout__SSR = styles__Layout__SSR(state.ctx, state.styles);
    state.scripts__Layout__SSR = scripts__Layout__SSR(state.ctx, state.scripts);
    state.company_name = company_name$5(state.$summary__company);
    state.title = title$1(state.ctx, state.company_name);
    return "" + Layout__SSR._render(__result, {
        ctx: state.ctx,
        meta: state.meta__Layout__SSR,
        styles: state.styles__Layout__SSR,
        title: state.title,
        scripts: state.scripts__Layout__SSR,
        components__load: state.components__load
    }, {
        store: options.store,
        slotted: {
            default: function () {
                return "\n  " + Page__Company._render(__result, {
                    ctx: state.ctx
                }, {
                    store: options.store
                }) + "\n";
            }
        }
    });
};
@btakita btakita changed the title v2 SSR computed properties: component _render method does not pass ref v2 SSR computed properties: component _render method does not pass ref object Apr 17, 2018
@Conduitry
Copy link
Member

Yup I can reproduce this. It looks like this is working properly on the v2 branch itself, but in v1 with the parser: 'v2' option, the incorrect code is generated for when the computed property is called. I'll take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants