mdn / yari

The platform code behind MDN Web Docs
Mozilla Public License 2.0
1.19k stars 508 forks source link

{{LiveSampleLink}} macro did not work properly #9485

Closed yin1999 closed 4 weeks ago

yin1999 commented 1 year ago

Summary

The {{LiveSampleLink}}macro did not work any more.

Check the link generated by LiveSampleLink macro in this section: https://live.mdnplay.dev/en-US/docs/MDN/Writing_guidelines/Page_structures/Live_samples/runner.html?id=Live_sample_demo

It would be an empty page.

URL

Section: https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Page_structures/Live_samples#result Live sample URL: https://live.mdnplay.dev/en-US/docs/MDN/Writing_guidelines/Page_structures/Live_samples/runner.html?id=Live_sample_demo

Reproduction steps

  1. navigate to https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Page_structures/Live_samples#result
  2. click the "Live sample demo link" link
  3. Got an empty web page.

Expected behavior

We could see the correct document.

Actual behavior

Got an empty web page.

Device

Desktop

Browser

Chrome

Browser version

Stable

Operating system

Android

Screenshot

No response

Anything else?

No response

Validations

wbamberg commented 1 year ago

I asked about this broken macro a week or so ago and there was some support from the writing team for removing this macro. I'll probably file some PRs for that next week, we'll see if it can be removed!

yin1999 commented 1 year ago

Thanks for the clarification @wbamberg. I'm trying to rewrite the example here with {{LiveSampleLink}} macro. Do you think it's also a good idea to use {{EmbedLiveSample}} instead?

wbamberg commented 1 year ago

Thanks for the clarification @wbamberg. I'm trying to rewrite the example here with {{LiveSampleLink}} macro. Do you think it's also a good idea to use {{EmbedLiveSample}} instead?

I think if you can use just {{EmbedLiveSample}} it's almost always better to do that. If you can't, maybe use {{EmbedGHLiveSample}}? Or honestly it could be made a non-live example - the example already shows some terrible practices, so having a non-live good practice example would IMO be a net improvement.

mirunacurtean commented 4 weeks ago

@yin1999 There has been work done affecting the macros and from checking I noticed the link now works across several browsers: F, Chrome, Safari. Could you double check and let us know if you can still reproduce this? image

yin1999 commented 4 weeks ago

@yin1999 There has been work done affecting the macros and from checking I noticed the link now works across several browsers: F, Chrome, Safari. Could you double check and let us know if you can still reproduce this?

I could open the page that displays correctly, thanks for the feedback on this issue :pray: