Docusaurus: Dynamic JS pages/components

Created on 15 Dec 2017  路  10Comments  路  Source: facebook/docusaurus

Hey guys! Loving this is open now, I hope to be able to contribute soon!

We've been using just a simple JS script on the Prettier docs playground and I've been pushing for a rewrite in React so we could do some cool stuff more easily:

  • creating the options sidebar automatically so a new PR that changes anything could be more easily integrated to the playground and people can play with it in the PR previews;
  • persisting the state in localStorage

To do that a build process would be necessary.. we currently just serve from /static, so I built a POC with the features above using Preact and https://github.com/developit/preact-in-es3/blob/master/index.js, but it's really cumbersome without JSX and would be nice to do it in React since that's what Docusaurus uses.

We could just build the playground independently聽(calling the transpiler/bundler and outputing directly to Docusaurus build dir), but would be nice to integrate this somehow so we could reuse the development server and have one script to build them all.

If this use case is something you guys would like to support, I'd love to help!

feature

Most helpful comment

We'd really like to be able to hydrate the React DOM on the client-side to support some interactions. Is that on the cards?

All 10 comments

@duailibe Thanks for writing this up. While not totally related, I believe @hramos had to do some customization to get the React Native web player running (e.g., http://facebook.github.io/react-native/docs/flexbox.html); so he might have some insight on this as well.

Let me talk this over a bit with the team.

cc: @ericnakagawa @hramos

We'd really like to be able to hydrate the React DOM on the client-side to support some interactions. Is that on the cards?

I believe this is now achieved in v2, should we close this @yangshun ?

There's a v2? 馃榾 Any changelog somewhere? The one in the root only mentions v1

Not yet released @SimenB. https://docusaurus.io/blog/2018/09/11/Towards-Docusaurus-2

Still working on it

I think we can close this.

On second thought, perhaps we shouldn't close these issues until v2 is released because people might file issues again if they don't see open issues addressing them. WDYT?

Hmm i'm kinda confused actually because usually when we merge PR that fix a bug we also close the corresponding issue until the next release as well 馃

That's true, but that's considering the next release will be out soon. We don't have a launch date for v2 yet. But I guess we can close it for now and see whether there are any downsides of closing them before actually launching.

Kinda agreed on second thought 馃. Nah maybe it's time for us to work to launch v2 sooner then before it backfires 馃槂

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ericnakagawa picture ericnakagawa  路  3Comments

lex111 picture lex111  路  3Comments

rickyvetter picture rickyvetter  路  3Comments

endiliey picture endiliey  路  3Comments

itelofilho picture itelofilho  路  3Comments