Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

jsx-demo not working #70

Open
KoenT-X opened this issue Jan 13, 2016 · 8 comments
Open

jsx-demo not working #70

KoenT-X opened this issue Jan 13, 2016 · 8 comments
Assignees

Comments

@KoenT-X
Copy link

KoenT-X commented Jan 13, 2016

I am trying to find out how to setup a simple Visual Studio 2015 project using TypeScript and React, so that I can just build and run from VS, but I can't seem to find any simple example of this...

So, I then tried to build and run the jsx-demo in this repository, following the instructions in the README.md file, and that didn't work either...

Step 1: npm install
This works but gives 2 warnings:
npm WARN package.json jsx-demo@0.0.1 license should be a valid SPDX license expression
WARN engine joi-assert@0.0.3: wanted: {"node":">= 0.10.0 <= 0.11.0"} (current: {"node":"4.2.4","npm":"2.14.12"})

Step 2: node node_modules/typescript/bin/tsc
This gives the following error:
src/app.tsx(19,11): error TS2339: Property 'render' does not exist on type 'typeof __React'.

Side note: if you could (please!) create a very simple Visual Studio 2015 (CE) project using TypeScript and React, that builds and runs out-of-the-box, that would be very helpful! Right now, I find it too difficult to get started quickly.

@RyanCavanaugh RyanCavanaugh self-assigned this Jan 13, 2016
@KoenT-X
Copy link
Author

KoenT-X commented Jan 15, 2016

If getting this to work out-of-the-box with Visual Studio 2015 (CE) is not possible, then adding some setup instructions for getting it to work with Visual Studio Code could also be helpful.

But I assume Visual Studio 2015 (CE) is more powerful than Visual Studio Code, and building, launching a browser and debugging the client should be as simple as what I'm doing now with a pure HTML + TypeScript project type?

Just a minimal example (not even using jquery) would be helpful.
This is the one I tried to make before coming here (but couldn't get it to work):
https://KoenT_IM@bitbucket.org/KoenT_IM/typescriptreacttests.git

Thanks for creating TypeScript and supporting React / TSX. It looks great!

@DanielRosenwasser
Copy link
Member

@johnnyreilly if you've got a bit of time to take a look at this as well, that'd be appreciated.

@johnnyreilly
Copy link
Contributor

Hi @DanielRosenwasser,

Judging by this it sounds like Visual Studio won't be a good place to use React until better tsconfig.json is available. I think this may happen with TypeScript 1.8 - hopefully @paulvanbrenk can confirm. Once that support is available I'll try and make this example a little clearer on how to use in multiple editors / IDEs. I'm fairly passionate about there being a level playing field between editors / IDEs so this is close to my heart.

@johnnyreilly
Copy link
Contributor

Oh and compileOnSave support being added. I think I saw mention that waas in the pipeline too.

Not certain what the story is with using watch support in Visual Studio though.

@KoenT-X
Copy link
Author

KoenT-X commented Jan 18, 2016

@johnnyreilly Good to hear this is going to be tackled! Any idea when that would be?
Having a minimal TypeScript + React example in VS2015 to start from would help a lot to get going. I'd love to continue to work with VS2015 (CE) also for the client, it's a great IDE!

@johnnyreilly
Copy link
Contributor

I'm planning to do it when TypeScript 1.8 ships (with associated changes for VS). I'm not sure when that will be though. Soon I hope!

@KoenT-X
Copy link
Author

KoenT-X commented Jan 19, 2016

OK, thanks. Looking forward to that.

@KoenT-X
Copy link
Author

KoenT-X commented Jan 27, 2016

In the meantime, I got a basic example working (not the jsx example from TypeScriptSamples though).

It's using the currently latest stable version of React (0.14.6, so where react and react-dom are split off), the AMD module loading system (using require.js), and VisualStudio 2015 CE. I started from the "HTML Application with TypeScript" project template in Visual Studio.
Repository on GitHub: https://bitbucket.org/KoenT_IM/typescriptreacttests

Can probably be made better still, but at least I've now got a working starting point.

Maybe this is useful for @johnnyreilly @DanielRosenwasser or @RyanCavanaugh as a starting point.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants