-
Notifications
You must be signed in to change notification settings - Fork 11
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
Fails at choo's server side render #20
Comments
Ah, I was wondering if this would work - we should add some tests to both
{micro,nano}component
…On Thu, Jun 1, 2017 at 1:55 PM Maciej Sitko ***@***.***> wrote:
In the express environment the attempt of SSR rendering choo results in:
this._element.getAttribute is not a function
Workaround involves passing a mock function in the server side js context
and importing the proper one from the client bundle endpoint. But its a
hacky solution.
So, with code:
`<div>${geoMap.render({ longitude, latitude, markers, city }, emit)}</div>`
One has to pass down component in nodejs state environment as something
like:
export default {
render: () => ''
};
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#20>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/ACWlenM8BmLCORebfGdqNUXy8lN3ipvgks5r_qbBgaJpZM4Ns4EM>
.
|
Ok, so it fails due to microcomponent wanting to get https://github.com/yoshuawuyts/microcomponent/blob/master/index.js#L46 the fix is to replace the line with: if (oldElement && oldElement.attributes) { It then renders fine on server side. |
Hey, so this module is mostly deprecated in favor of nanocomponent -
there's also funcomponent and component-box that are making some cool
progress and similar to this. If you're interested in this, consider
dropping by on IRC sometime! :D
…On Sat, Sep 16, 2017 at 4:32 PM Maciej Sitko ***@***.***> wrote:
Ok, so it fails due to microcomponent at line wanting to get .attributes
on the server (which isn't available):
https://github.com/yoshuawuyts/microcomponent/blob/master/index.js#L46
the fix is to replace the line with:
if (oldElement && oldElement.attributes) {
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACWlejLbdktmmRJkIL62k0-UMmH9VYY7ks5si9v3gaJpZM4Ns4EM>
.
|
Hmm okay. I did a cleanup as some folks are still using it and don't know it (including me (: ). Its closer to react mindset and some companies have mostly react devs that think and dream of this.props. |
Yeah, we definitely want to get closer to that. Just not entirely settled
on the approach yet; tho I feel like we can figure it out! :D
…On Tue, Sep 19, 2017 at 9:46 PM Maciej Sitko ***@***.***> wrote:
Hmm okay. I did a cleanup as some folks are still using it and don't know
it (including me (: ). Its closer to react mindset and some companies have
mostly react dev that think of props.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACWlenQ-Cp7wWDgoqPID5CwavRT5HJijks5skBowgaJpZM4Ns4EM>
.
|
In the express environment the attempt of SSR rendering choo results in:
this._element.getAttribute is not a function
Workaround involves passing a mock function in the server side js context and importing the proper module from the client bundle endpoint. But its a hacky solution.
So, with code:
`<div>${geoMap.render({ longitude, latitude, markers, city }, emit)}</div>`
One has to pass down component in nodejs state environment as something like:
I believe its not a big fix to make this assumption dependant on the runtime context.
I realise this is probably more to do with
nanocomponent
but it fails in both places and I only wanted to create one issue ticket.The text was updated successfully, but these errors were encountered: