Skip to content

Instantly share code, notes, and snippets.

@didi0613
Last active May 17, 2018 00:48
Show Gist options
  • Select an option

  • Save didi0613/138143b391c752a30e55203c4aa3f2aa to your computer and use it in GitHub Desktop.

Select an option

Save didi0613/138143b391c752a30e55203c4aa3f2aa to your computer and use it in GitHub Desktop.
OSS Component Server Side Rendering Issue

OSS Component Server Side Rendering Issue

I’ve spend some time on consuming electrode component from demo folder instead of src, and here is the example component:
https://github.com/didi0613/oss-electrode-component-css-modules-example

Root Cause

Within the demo folder, we are using electrode-demo-index for demoing the component. However, it is not working with Server side rendering. The reason behind is that electrode-demo-index has codemirror as its dependency, when server side rendering enabled, it will looking for window navigator which is only valid when client side comes in.

Question

  • seems electrode explore is inactively maintained right now, and we have plans to migrate to bitsrc, do we still need to change from consuming component from src folder to demo folder?
  • if we still wants to use electrode-demo-index, we will need to re-write part of it to make it work with ssr?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment