Skip to content

Support xml namespaces in JSX #13728

Closed
Closed

Description

@mstijak

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.

Activity

  1. added
    info-needed
    javascript
    on Oct 14, 2016
  2. waderyan commented on Oct 14, 2016

    @waderyan

    Marko Stijak (@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.

  3. mstijak commented on Oct 16, 2016

    @mstijak
    Author

    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).

    react/jsx#66

  4. waderyan commented on Oct 24, 2016

    @waderyan

    Marko Stijak (@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.

    Mohamed Hegazy (@mhegazy) and Dirk Bäumer (@dbaeumer) can you advise Marko Stijak (@mstijak) on what he can do here?

  5. added
    info-needed
    and removed
    info-needed
    on Oct 24, 2016
  6. dbaeumer commented on Oct 25, 2016

    @dbaeumer
    Member

    Wade Anderson (@waderyan) this needs to be done by the tsserver since according to Marko Stijak (@mstijak) we report an syntax error here.

  7. mstijak commented on Oct 25, 2016

    @mstijak
    Author

    It looks like this:

    error

  8. waderyan commented on Oct 25, 2016

    @waderyan

    This issue was moved to microsoft/TypeScript#11833

  9. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

info-neededjavascript

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions