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

New features has TKO? #99

Open
Eisenspalter opened this issue Apr 22, 2019 · 2 comments
Open

New features has TKO? #99

Eisenspalter opened this issue Apr 22, 2019 · 2 comments

Comments

@Eisenspalter
Copy link

Which new features, something like native JSX/TSX support or Decorators does TKO offer?

@nmocruz
Copy link

nmocruz commented Apr 25, 2019

I saw some jsx stuff here. Seems like the TSX is dependent on the typescript support, I was trying to used it, but seems like is missing some typing support, that was started and not sure if completed.
about decorators there's a nice library that I'm using https://github.com/gnaeus/knockout-decorators, not sure if some ideas could be native supported by tko as separated module.

@brianmhunt
Copy link
Member

TKO has native JSX support now. The transpiler (webpack, babel, typescript) needs to use ko.jsx.createElement and ko.jsx.Fragment for the respective React equivalents (React.createElement and React.Fragment).

For example, in Babel, this would look like:

plugins: [
    ["@babel/plugin-transform-react-jsx", {
      "useBuiltIns": true,
      "pragma": "ko.jsx.createElement",
      "pragmaFrag": "ko.jsx.Fragment",
      "throwIfNamespace": false,
    }],
]

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

No branches or pull requests

3 participants