playground icon indicating copy to clipboard operation
playground copied to clipboard

Support for Reason

Open ShalokShalom opened this issue 8 years ago • 16 comments

I like to see Reason on the Playground.

ShalokShalom avatar Sep 06 '17 11:09 ShalokShalom

Check out https://reasonml.github.io/try/

glennsl avatar Sep 06 '17 11:09 glennsl

I prefer the Playground for its dark background, the examples and it is also way more overseeable to me.

ShalokShalom avatar Sep 06 '17 13:09 ShalokShalom

There will be a new BuckleScript website in the near future, based on infrastructure used to make the reason website, which will most likely use the same playground as is used there. Whether it'll have a dark background I don't know, but I doubt anything will be done to this playground until then. Especially considering there's already a reason playground that supports the use case :)

glennsl avatar Sep 06 '17 14:09 glennsl

Check out https://reasonml.github.io/try/

Interestingly I cannot do anything on that page. Cannot type in to anything, no scripts blocked, no errors in console... Interesting...

OvermindDL1 avatar Sep 06 '17 14:09 OvermindDL1

The current version overrides console logging to capture program output, so there may still be errors. I just had a PR merged that does the evaluation and output capturing in a web worker instead, but the site hasn't been updated to use it yet.

cc @chenglou @jaredly

glennsl avatar Sep 06 '17 14:09 glennsl

What bothers me, is that a lot of the examples all over the page are not working in the try section, including the example on the front page.

ShalokShalom avatar Sep 06 '17 17:09 ShalokShalom

There's work underway to have both a selection of examples in the playground, and runnable examples in the guide and elsewhere.

See https://github.com/reasonml/reasonml.github.io/pull/128 and https://github.com/reasonml/reasonml.github.io/pull/145 for details

glennsl avatar Sep 06 '17 17:09 glennsl

@OvermindDL1 could you give a screenshot of what you see? Also what browser are you using? https://reasonml.github.io/try/?reason=DYUwLgBAHhC8EEYAMBuAUAKQM4DpgHsBzaFIA image this is what it should look like. NOTE if you're using a browser other than chrome/firefox/safari, I can't vouch for your success.

jaredly avatar Sep 06 '17 17:09 jaredly

You can copy-and-paste any of the examples here if you want to try them out right away: https://github.com/reasonml/reasonml.github.io/pull/128/files#diff-d91ff326bb64b518c5748a72456cbb64R26

glennsl avatar Sep 06 '17 17:09 glennsl

@ShalokShalom given that there already is a reason playground, would you like to open an issue there (https://github.com/reasonml/reasonml.github.io/issues) expressing your styling preferences?

jaredly avatar Sep 06 '17 17:09 jaredly

@jaredly I'm running Chrome 60.

Your https://reasonml.github.io/try/?reason=DYUwLgBAHhC8EEYAMBuAUAKQM4DpgHsBzaFIA link works, what I saw before were the 4 boxes with their labels in the upper-right corners but they were entirely blank and unclickable, no code or line numbers in them.

Hmm, on some reloads I'm seeing things like this pop into the console:

Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' *". Either the 'unsafe-inline' keyword, a hash ('sha256-70UX0+cT/qf3p1Q8SUy0Vohe36d1GERDgd51d0kP+6g='), or a nonce ('nonce-...') is required to enable inline execution.

For note, I'm at work, and the browsers are enforced to certain security guidelines that do make things like react work poorly depending on how it is coded (yet not anything else that I've run across).

OvermindDL1 avatar Sep 06 '17 18:09 OvermindDL1

Oh, there is one more: https://reasonml.github.io/reason-tools/popup.html#

ShalokShalom avatar Sep 08 '17 16:09 ShalokShalom

@OvermindDL1 that sounds like a chrome extension you're using is acting up. CSPs only apply, as far as I know, if a) the html document explicitly requires it (which ours doesn't) or b) the code is in a chrome extension.

jaredly avatar Sep 08 '17 18:09 jaredly

It could be his employer uses a proxy that adds http headers or injects html code into webpages, which would be nuts, but i've seen worse. The playground does use eval, so the warning/error makes perfect sense if that's the case.

glennsl avatar Sep 08 '17 19:09 glennsl

It could be his employer uses a proxy that adds http headers or injects html code into webpages, which would be nuts, but i've seen worse. The playground does use eval, so the warning/error makes perfect sense if that's the case.

No, they just do things like block requests that don't match the same security as the origin and things like that. No rewriting.

@OvermindDL1 that sounds like a chrome extension you're using is acting up. CSPs only apply, as far as I know, if a) the html document explicitly requires it (which ours doesn't) or b) the code is in a chrome extension.

I mostly just have uMatrix, but even entirely disabling it still had that randomly. It only ever happens on sites that use react I've noticed but I've not looked closely enough to find a pattern yet. Happens both at work and at home (at home I have a lot of extensions, not so at work).

OvermindDL1 avatar Sep 11 '17 16:09 OvermindDL1

Hmm, I use uMatrix too. Never seen anything like this, or had a problem with the reason playground once the necessary scripts were whitelisted.

glennsl avatar Sep 11 '17 18:09 glennsl