{"action":"created","issue":{"url":"https://api.github.com/repos/marko-js/marko-widgets/issues/86","labels_url":"https://api.github.com/repos/marko-js/marko-widgets/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/marko-js/marko-widgets/issues/86/comments","events_url":"https://api.github.com/repos/marko-js/marko-widgets/issues/86/events","html_url":"https://github.com/marko-js/marko-widgets/issues/86","id":103591929,"number":86,"title":"client-side rendering issues with `<lasso-slot>` and `out.global`","user":{"login":"yomed","id":3595986,"avatar_url":"https://avatars.githubusercontent.com/u/3595986?v=3","gravatar_id":"","url":"https://api.github.com/users/yomed","html_url":"https://github.com/yomed","followers_url":"https://api.github.com/users/yomed/followers","following_url":"https://api.github.com/users/yomed/following{/other_user}","gists_url":"https://api.github.com/users/yomed/gists{/gist_id}","starred_url":"https://api.github.com/users/yomed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yomed/subscriptions","organizations_url":"https://api.github.com/users/yomed/orgs","repos_url":"https://api.github.com/users/yomed/repos","events_url":"https://api.github.com/users/yomed/events{/privacy}","received_events_url":"https://api.github.com/users/yomed/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-27T20:47:03Z","updated_at":"2015-08-27T20:49:33Z","closed_at":null,"body":"I have a widget template that looks roughly like this:\r\n\r\n```\r\n<lasso-slot name=\"inline-js\" />\r\n<div class=\"${out.global.wrapperClassName}\"> <!-- access out.global in some way -->\r\n    <div w-bind class=\"${data.widgetClassName}\"> <!-- not highest level element in the template -->\r\n        ...\r\n    <div>\r\n</div>\r\n```\r\n\r\nIn my index.js file (approximately):\r\n```\r\nmodule.exports = require('marko-widgets').defineComponent({\r\n    template: template,\r\n\r\n    getInitialState: function(input, out) {\r\n        input.widgetClassName = 'widget'\r\n        return input;\r\n    },\r\n\r\n    getTemplateData: function (state, input) {\r\n        return state;\r\n    },\r\n\r\n    changeWidgetClassName: function () {\r\n        this.setState('widgetClassName', 'widget2');\r\n    }\r\n```\r\n\r\nThe initial server render works fine, but I run into problems whenever I trigger a client rerender via `changeWidgetClassName.` It seems to choke on the lasso-tag, even though it is outside the w-bind. The .marko.js file contains something like this:\r\n```\r\n__tag(out,\r\n      _________node_modules_lasso_taglib_slot_tag_js,\r\n      {\r\n        \"name\": \"inline-js\"\r\n      });\r\n```\r\n\r\nAnd in the rerender it errors out:\r\n```\r\nUncaught Error: Lasso page result not found for slot \"inline-js-before-resultset\". The <lasso-page> tag should be used to lasso the page.render @ slot-tag.js:20\r\nmodule.exports.t @ helpers.js:275\r\nrender @ template.marko.js:37\r\nTemplate.render @ marko-runtime.js:192\r\nrenderer @ defineRenderer.js:191\r\nexports.render @ raptor-renderer.js:67\r\n(anonymous function) @ Widget.js:463\r\nbatchUpdate @ update-manager.js:80\r\nwidgetProto._rerender @ Widget.js:461\r\nwidgetProto.rerender @ Widget.js:484\r\nwidgetProto.doUpdate @ Widget.js:390\r\nwidgetProto.update @ Widget.js:352\r\nupdateWidgets @ update-manager.js:59\r\nbatchUpdate @ update-manager.js:86\r\n(anonymous function) @ marko-widgets-browser.js:109\r\n```\r\n\r\n\r\nIf I remove the lasso-tag, it chokes on `out.global` properties being undefined. And finally if I remove all of those, it still attempts to rerender the entire template, rather than just the `w-bind`ed part and below. So a few questions:\r\n\r\n1) Does `w-bind` always have to be at the highest parent level of the template?\r\n2) Should `<lasso-slot>` be kept out of client-rendered widgets?\r\n3) Are there any gotchas for using `out.global` on the client?\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/marko-js/marko-widgets/issues/comments/135551567","html_url":"https://github.com/marko-js/marko-widgets/issues/86#issuecomment-135551567","issue_url":"https://api.github.com/repos/marko-js/marko-widgets/issues/86","id":135551567,"user":{"login":"patrick-steele-idem","id":978214,"avatar_url":"https://avatars.githubusercontent.com/u/978214?v=3","gravatar_id":"","url":"https://api.github.com/users/patrick-steele-idem","html_url":"https://github.com/patrick-steele-idem","followers_url":"https://api.github.com/users/patrick-steele-idem/followers","following_url":"https://api.github.com/users/patrick-steele-idem/following{/other_user}","gists_url":"https://api.github.com/users/patrick-steele-idem/gists{/gist_id}","starred_url":"https://api.github.com/users/patrick-steele-idem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrick-steele-idem/subscriptions","organizations_url":"https://api.github.com/users/patrick-steele-idem/orgs","repos_url":"https://api.github.com/users/patrick-steele-idem/repos","events_url":"https://api.github.com/users/patrick-steele-idem/events{/privacy}","received_events_url":"https://api.github.com/users/patrick-steele-idem/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T20:49:33Z","updated_at":"2015-08-27T20:49:33Z","body":"> 1) Does w-bind always have to be at the highest parent level of the template?\r\n\r\nNo, it does not\r\n\r\n> 2) Should `<lasso-slot>` be kept out of client-rendered widgets?\r\n\r\nYes, it should only be in server-side templates.\r\n\r\n> 3) Are there any gotchas for using out.global on the client?\r\n\r\nYes, when a rerender happens it manufactures a new `out` that will not have any user globals.\r\n"}}