question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Purpose of Typescript Javascript Menu Items in Playground

See original GitHub issue

Ref:

If the current PG is in Javascript and you switch to Typescript the current PG holds, and vice versa

from https://forum.babylonjs.com/t/please-welcome-the-new-playground/5135/14?u=johnk

May be related to #6755

Maybe its just me, or maybe I am missing something but I find the Typescript Javascript Menu Items in the playground a bit strange. Why?

[In the following argument the words Typescript and JavaScript can be swapped over]

A new Babylon.js user comes across a JavaScript playground (via the forum for example) and sees Typescript on the menu. “Wow” he says "I can use Typescript in the playground and gives it a click. Something appears to be happening, the menu bar takes on an orange appearance, he waits in anticipation and then, “Oh its gone back to JavaScript”, he says “Now what”.

Luckily he is the persevering type and goes to the docs https://doc.babylonjs.com/features/playground#playground-url-formats and follows the first Typescript link, “Excellent” he thinks “I now can write Typescript code”. “Next time” he thinks "I will just type in the URL https://www.babylonjs-playground.com/#. When he does this he is pleased to find it does take him to the basic Typescript PG. Looking at the table at https://doc.babylonjs.com/features/playground#playground-url-formats again he does think it a bit strange that the first JavaScript link in the table is also https://www.babylonjs-playground.com/# and clicking on it leads to a Javascript PG. “One URL two sites?, A little weird!” he thinks.

Further persevering he finds that if he first clicks on the NEW button or CLEAR (DELETE?) button and then on the Typescript menu item he will be taken to a Typescript PG. “Why do not NEW and CLEAR lead to a choice of Typescript or Javascript and just use Typescript or Javascript as labels to show which language is used?” he thinks.

Of course the answer to this last question is that having both on the menu makes it clear that both are available. IMHO it would be less confusing and make more sense that clicking on Typescript actually took you to the basic Typescript PG and vice versa.

Thoughts?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
deltakoshcommented, Aug 22, 2019

Still having the same issue, for example when I go to https://playground.babylonjs.com/#QYFDDP#1 and click on the Orange Typescript on the menu it tries to go to Typescript but then goes back to the same Javascript content. I have tried Firefox, Chrome and Edge and get the same result.

I agree this is not good. I’ll chat with @noalak to fix that issue

Same for the other way around

1reaction
deltakoshcommented, Aug 22, 2019

Well when I click on Typescript (even if we agree on the color issue that was flagged for @PatrickRyanMS), you switch to TS in the editor.

We maybe need to mention on the doc that by default the playground is in JS mode unless you open it using ts.html ?

New and clear will behave based on the current mode (TS or JS)

I need to check with @PatrickRyanMS to see how we can better indicate the current mode and have an option somewhere (but less prominent) that you can change modes

Read more comments on GitHub >

github_iconTop Results From Across the Web

TS Playground - An online editor for exploring TypeScript and ...
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.
Read more >
playground-elements - npm
Playground automatically compiles .ts files using TypeScript, and automatically fetches typings for your imports in order to display errors.
Read more >
Existing Typescript Playgrounds Redirected to Javascript or ...
If they exist they redirect to the Javascript PG and and i... ... Purpose of Typescript Javascript Menu Items in Playground #6760.
Read more >
How to import library with TypeScript Playground - Edureka
[ERR]: Executed JavaScript Failed: [ERR]: Cannot use import ... TypeScript Playground also has an export menu where you can open your code ...
Read more >
Playground | Babylon.js Documentation
You can write the code in JavaScript or Typescript. The playground software compiles the code to JavaScript, in the background, before rendering. Scene...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found