-
Notifications
You must be signed in to change notification settings - Fork 12k
Cli build should support loading modules with *.tsx extension. #8046
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
Comments
Discussed offline, we should support |
Any chance to got this in 1.5.0 ? |
…sx extension, closes angular#8046
…sx extension, closes angular#8046
What work is left to pull this PR? |
Add support for tsx syntax in component files Closes angular#8046
Add support for tsx syntax in component files Closes angular#8046
Is there any workaround this issue? |
UGLY workaround: https://gist.github.com/majo44/4862b8e7db6254975669e0a3f9d67a2a#file-angular-cli-1-5-0-tsx-loading-ugly-fix (we have this in postinstall) We are working on PR. |
@majo44 thx, I guess it's better solution then ejecting to webpack |
@majo44 any news regarding the PR ? |
@urish unfortunately we are not actively working on PR, so far we stick with workaround and old version of cli :( |
The workaround also works with the latest CLI (tested last night), however
I'd love to see this integrated into the CLI...
…On Feb 9, 2018 11:50 AM, "majo44" ***@***.***> wrote:
@urish <https://github.com/urish> unfortunately we are not actively
working on PR, so far we stick with workaround and old version of cli :(
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8046 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA2dnhwMKvidy9Io7JXPh0VcpnPJT8Swks5tTBTSgaJpZM4P4oRF>
.
|
@urish It has stopped work with @angular/cli >= 1.7.0 |
@majo44 PR thanks. |
@psamusev I am working fine with 1.7.3, so what's the problem you faced? |
@lygstate I'm talking about live reload with help of ng serve - server doesn't see changes and doesn't execute reload |
@psamusev It sees them one level deep (i.e myfile.ts |
@rsxdalv I expect it shouldn't work in this way :) |
@psamusev Eyes open for your PR. |
workaround is to make import with .tsx at the end if import file name
|
related ticket: angular/angular-cli#8046
@psamusev this does not work. Using your suggestion it errors out:
|
@sakalys you have to import only with string path. I mean
works, however
will not work |
Oh, thank you, sir. I'll definitely check. |
@angular/cli 6.0.1 still can't use and the ugly fix not works any more |
@zh99998 Take advantage of versioning: downgrade. Very few updates have been worth their salt beyond reducing future upgrade pains. Later, you might be able to revert back to 6.0.1 when the fix is updated. |
Just sent a PR to make it work with the latest CLI (6.x). I'm using this in one of my projects successfully. Fingers crossed! 🤞 |
@urish looks like your fix doesn't work when build is for server module (I create universal product) Error is following |
I'm currently solving this issue in an extra build step for projects containing jsx: import * as ngPackage from 'ng-packagr'
ngPackage
.ngPackagr()
.forProject(
'projects/<angular-lib-project>'
)
.withTsConfig(
'projects/<angular-lib-project>/tsconfig.lib.json'
)
.build()
.catch(error => {
console.error(error)
process.exit(1)
}) The file layout of the library can remain as is in this case. You'll also have to add |
How i can test *.spec.tsx files? Have anyone that problem? |
I'm using webpack.extra.js
I think I wonder why this patch didn't fix it... |
Are there any updates on this? For us Do you need a reproduction case? |
@davidenke There is a PR to fix it - #11407 |
@psamusev it's not reviewed yet, maybe because of the failed circle ci tests? |
@davidenke I think so. |
Support has been merged and will be available in 7.0. |
I have been unable to get this working at all. Is it documented anywhere so that I can confirm I am on the right versions of everything? |
@jimthedev |
@ahpoi This worked for me. It seems to be working pretty well. |
For future travelers - when using jsx with stenciljs I needed to have these two config options in "jsx" : "react",
"jsxFactory" : "h" |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions.
Repro steps.
ng new testproject
"jsx": "react",
"jsxFactory": "h"
ng build
The log given by the failure.
Desired functionality.
The tsx is providing just extended syntax sugar, which can be used for different porpoises. In my case I'm using mono-repo approach and I'm delivering part of components as web-components where I'm using jsx/tsx.
For compiler there should not be difference in extension of module.
Ropen of angular/angular#19691 (comment)
The text was updated successfully, but these errors were encountered: