Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support xml namespaces in JSX #13728

Closed
mstijak opened this issue Oct 14, 2016 · 6 comments
Closed

Support xml namespaces in JSX #13728

mstijak opened this issue Oct 14, 2016 · 6 comments
Assignees
Labels
info-needed Issue requires more information from poster javascript JavaScript support issues

Comments

@mstijak
Copy link

mstijak commented Oct 14, 2016

Visual Studio Code reports syntax errors if namespaces are used inside JSX.

Namespaces are not supported by React (babel-plugin-transform-react-jsx),
but Babel correctly parses them (babel-plugin-syntax-jsx).

Is this something that should be added directly to VSCode or an extension would be a better choice?

WebStorm and Sublime Text do not have this problem.

@waderyan waderyan added info-needed Issue requires more information from poster javascript JavaScript support issues labels Oct 14, 2016
@waderyan
Copy link

@mstijak thank you for opening this issue. Would you mind sharing a simple code example? I believe this is an issue for the JavaScript language service.

@mstijak
Copy link
Author

mstijak commented Oct 16, 2016

I'm developing a framework which offers advanced data-binding options. It's a non-standard use case, but namespaces provide a very convenient syntax.

This is how you declare a two-way data binding:

<NumberField value:bind="person.height" />

You can see the full example here:
http://cx.codaxy.com/fiddle/?f=luv00Rpw

Also, I noticed that of the leading React developers is considering using react namespace to distinguish React-related attributes from everything else (e.g. react:key).

facebook/jsx#66

@waderyan
Copy link

@mstijak very cool! I don't believe this is supported through an extension today. This may be a good candidate for a PR on the JavaScript language service or an extensibility point for the language service.

@mhegazy and @dbaeumer can you advise @mstijak on what he can do here?

@waderyan waderyan added info-needed Issue requires more information from poster and removed info-needed Issue requires more information from poster labels Oct 24, 2016
@dbaeumer
Copy link
Member

@waderyan this needs to be done by the tsserver since according to @mstijak we report an syntax error here.

@mstijak
Copy link
Author

mstijak commented Oct 25, 2016

It looks like this:

error

@waderyan
Copy link

This issue was moved to microsoft/TypeScript#11833

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster javascript JavaScript support issues
Projects
None yet
Development

No branches or pull requests

3 participants