Cell types in new Observable?

Hi,

A few days ago, two of the cell types were:

  • TypeScript .ts
  • JavaScript .js

Today, those two seem to have become one:

  • JavaScript .ts

Although, the notebooks I made a few days ago still have cells labelled .js

I’m confused. I know that JavaScript is a subset of TypeScript, but it isn’t clear to me what the new mixed label is trying to convey.

Thanks,
Adam

The same cell modes are still available, they’re just labeled differently.

Rather than calling them “JavaScript” and “TypeScript”, they are now both called “JavaScript”, and there’s a separate “Strip types” option, enabled by default, to run TypeScript natively. (You should almost never need to disable Strip types; it’s there mostly for backwards compatibility to avoid opting all existing JavaScript cells into type stripping.)

JavaScript with Strip types off is equivalent to the old JavaScript mode, and is labeled js.

JavaScript with Strip types on is equivalent to the old TypeScript mode, and is labeled ts, and is the default for new cells and when you pick JavaScript from the cell menu.

I changed this to address a different confusion where people don’t know that TypeScript is a superset of JavaScript, and seeing TypeScript was confusing, causing people to look for a JavaScript cell mode even though they could have used TypeScript. That confusion was raised here and here.

I appreciate your desire to reduce confusion, but I’m worried that having the default use the combination of the name “JavaScript” and the extension .ts is going to be more confusing, not less. Your average newbie “knows” that JavaScript files should end in .js. Maybe at least change it to “JavaScript/TypeScript”?

I wanted to retain some indication that the cells have type stripping enabled (or not) without needing to open the cell menu. If we show js in both cases, you can’t easily tell whether types are allowed or not.