-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
v2pre ts bug, not happy with typed const arrow functions #7295
Comments
@xHomu I have the same issue, created a minimum repro here: const ignoredRoutePatterns = [
"**/.*",
"**/components/**",
"**/integration/*.test.*",
];
module.exports = {
ignoredRouteFiles: ignoredRoutePatterns,
serverDependenciesToBundle: [/^marked.*/],
tailwind: true,
serverModuleFormat: "cjs",
}; it breaks, but if you do the following: const ignoredRoutePatterns = [
- "**/.*",
+ "**/*",
"**/components/**",
"**/integration/*.test.*",
];
module.exports = {
ignoredRouteFiles: ignoredRoutePatterns,
serverDependenciesToBundle: [/^marked.*/],
tailwind: true,
serverModuleFormat: "cjs",
}; it works |
@AlemTuzlak Setting @xHomu Needing to disambiguate single-arg generics from JSX elements has been a thing in TS for a long time. Here's a playground repro: https://tsplay.dev/w6Vqyw . Note that changing the TS version to anything (3.3-5.2) results in the same error. To fix your code, you don't have to remove arrow functions. You can put a comma after the Not sure why you'd only run into this in v2 and not 1.19.3, but maybe we fixed something in the compiler to be more TS compliant. But I'd argue that's a feature, not a bug. |
@pcattori so what you're saying is we're idiots 🤣 (for anyone reading this in the future, it's a joke) |
Well, he's not wrong! |
@duailibe unfortunately, there's a ton of existing apps and libraries that use |
.jsx I get but how can you have jsx in ts files without ts going crazy and complaining on you? I get why you made the decision but why would people ask for tsx in ts support when there is a clear destinction between the two |
@pcattori I understand the reasoning for IMHO the best heuristics would be:
or something similar (again, best in my opinion anyway). |
To be clear, #7051 was a bug fix for a breaking change. The decision to support JSX in |
@pcattori Sorry for insisting but that's not why I see in my 1.19.3 app. Just rename a
|
This would be the behaviour I would expect if there was JSX in a TS file, didn't even know theres a way to go around it |
Ah ok then maybe I misspoke earlier. I assumed we had supported JSX in |
@pcattori thanks for the patience! I believe that would align with how the loaders are configured for the build: remix/packages/remix-dev/compiler/utils/loaders.ts Lines 21 to 22 in 848c8ea
remix/packages/remix-dev/compiler/utils/loaders.ts Lines 38 to 39 in 848c8ea
|
Fixed by #7306 |
🤖 Hello there, We just published version Thanks! |
This reverts commit db92e49.
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
1 similar comment
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
What version of Remix are you using?
2.0.0-pre.2
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
Upgrading to v2 release candidate from v1.19.3 is fairly painless on mana.wiki, except for this one weird Typescript error that I don't know what might be the sourced from:
Updating the .ts files so they don't use arrow functions got the build working, otherwise, great release!
Expected Behavior
Remix shouldn't have an opinion about how I declare functions in typescript files.
Actual Behavior
Remix is very insistent on me stop using const arrow functions.
The text was updated successfully, but these errors were encountered: