Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Improve usage of components with Server Side Rendering #62

Closed
pragmaticivan opened this issue Dec 5, 2017 · 2 comments
Closed

Improve usage of components with Server Side Rendering #62

pragmaticivan opened this issue Dec 5, 2017 · 2 comments

Comments

@pragmaticivan
Copy link
Contributor

I'm working on moving away from JSDOM usage, but some components are still depending on that.

ex:

> info Ready on http://0.0.0.0:3005
> ERR!   ReferenceError: document is not defined
> ERR!
> ERR!   - Dropdown.js:64 Dropdown.attached
> ERR!     [console]/[marble-dropdown]/lib/Dropdown.js:64:52
> ERR!
> ERR!   - Component.js:243 Dropdown.attach
> ERR!     [console]/[metal-component]/lib/Component.js:243:10
> ERR!
> ERR!   - Component.js:633 Dropdown.renderComponent
> ERR!     [console]/[metal-component]/lib/Component.js:633:9
> ERR!
> ERR!   - render.js:561 renderSubComponent_
> ERR!     [console]/[metal-incremental-dom]/lib/render/render.js:561:8
> ERR!
> ERR!   - render.js:473 renderFromTag_
> ERR!     [console]/[metal-incremental-dom]/lib/render/render.js:473:14
> ERR!
> ERR!   - render.js:220 Topbar.handleChildrenCaptured_
> ERR!     [console]/[metal-incremental-dom]/lib/render/render.js:220:9
> ERR!
> ERR!   - children.js:161 handleInterceptedCloseCall_
> ERR!     [console]/[metal-incremental-dom]/lib/children/children.js:161:24
> ERR!
> ERR!   - incremental-dom-aop.js:110 Object.handleCall
> ERR!     [console]/[metal-incremental-dom]/lib/incremental-dom-aop.js:110:12
> ERR!
> ERR!   - incremental-dom-aop.js:91 fnVoid
> ERR!     [console]/[metal-incremental-dom]/lib/incremental-dom-aop.js:91:37
> ERR!
> ERR!   - incremental-dom-aop.js:110 Object.handleCall
> ERR!     [console]/[metal-incremental-dom]/lib/incremental-dom-aop.js:110:12
> ERR!
> ERR! {
> ERR!   "status": 500,
> ERR!   "message": "document is not defined"
> ERR! }

I suggested reducing the amount of lifecycle to mimic what React does for SSR: metal/metal.js#318

Not sure if it would be accepted, but we also can work on having workarounds for when the component is rendered on SSR

@pragmaticivan
Copy link
Contributor Author

For reference: metal/metal.js#326

@zenorocha
Copy link
Contributor

Done on #66

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

No branches or pull requests

2 participants