mdn / content

The content behind MDN Web Docs

Home Page:https://developer.mozilla.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace the samples-server

wbamberg opened this issue · comments

MDN had a custom server, https://github.com/mdn/samples-server. According to the README it's for for live samples that need "a less restrictive environment than running in an iframe on Kuma" - most particularly I think for samples that need some custom server-side handling.

We've decommissioned the sample server, so we need to find a replacement.

I believe this server only served four examples that are used on MDN:

https://mdn-samples.mozilla.org/snippets/html/iframe-simple-contents.html
https://mdn-samples.mozilla.org/s/webrtc-capturestill
https://mdn-samples.mozilla.org/s/webrtc-simple-datachannel
https://mdn-samples.mozilla.org/s/websocket-chat

...referenced from the following MDN pages:

https://developer.mozilla.org/en-us/web/html/element/iframe/
https://developer.mozilla.org/en-us/web/api/webrtc_api/taking_still_photos/
https://developer.mozilla.org/en-us/web/api/webrtc_api/simple_rtcdatachannel_sample/
https://developer.mozilla.org/en-us/web/api/websockets_api/writing_websocket_client_applications/

Since there are only a very few pages involved, it would be good to do this cheaply: to avoid making this a huge project or one that gives the dev team an lot of extra code to maintain.

The most urgent example is probably the iframe one referenced from https://developer.mozilla.org/en-us/web/html/element/iframe/ - someone already filed an issue about this: #4116. This is also probably the easiest to fix, since it doesn't require a custom server-side component.

One suggestion is to use (something like) Glitch, and it would probably be worth trying this out.

An idea I had yesterday while the meeting was already coming to an end: We could also publish these node apps and instead of linking to a server we have to maintain (and/or pay for), we could ask people to run something like:

npx @mdn/sample-server websocket-chat

Which could then also open the site in their default browser.

A downside: It would burden the people with having to have installed Node beforehand.

Is the suggestion that normal MDN readers should do this, just to use our examples? I think that is too much to ask.