1

Can Typescript or ES6 JavaScript be used when creating a UWP JavaScript project?

Its quite a broad question but theres not much info online so asking here.

1
  • This is surprisingly hard to find info for. I mean, the answer is yeah sure if babel and the typescript compiler can target ancient versions of Internet Explorer you can probably make it work for UWP, but not much info on the web. Commented Jun 18, 2018 at 21:06

2 Answers 2

3

I do not see why this would not be possible. Windows Dev Center - What's a Universal Windows Platform (UWP) app? clearly states that JavaScript and HTML can be used. TypeScript is transpiled into JavaScript. If you are concerned with using ES6 features that may not be supported, you can use Babel.

Sign up to request clarification or add additional context in comments.

1 Comment

This is a good answer. Basically, if anything supports JavaScript at all, you can always transpile with Babel to an older version of JavaScript even if it doesn't support all of the latest bells and whistles.
0

If you mean native support without a build step, then no, you have no ES 6/Typescript support. Nor will it be coming: microsoft has their WinJS runtime for native apps in maintenance mode with no new features planned. They're pushing C# and Xamarin (which they acquired 2 years ago). Here is a WinJS playground where you can see that features like let cause a syntax error.

You can however compile modern JavaScript or TypeScript to ES 3 JavaScript using babel or the TypeScript compiler. TypeScript in particular must be compiled: nothing I know of runs it natively (not even Microsoft's own Edge browser.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.