Comments (8)
Thanks for opening this issue, @nicolasrenon.
In short, our goal in Remix is to seamlessly support both JavaScript and TypeScript. If you name a file with a .ts
or .tsx
extension, we will treat it as TypeScript (.tsx
is for TypeScript files with JSX in them). But it isn't required. You can write all your files as .js
files if you don't want TypeScript.
Right now we will automatically compile any .ts
and .tsx
files in the app
directory. In the starter-express repo, we also support .ts
and .tsx
files in the loaders
directory, though we just use tsc
to compile them directly instead of our own compiler. This will probably change in the near future.
I agree that we should update the docs with more info about this, so I'll leave this issue open to remind me to do that at some point. Hopefully this explanation helps for now! Happy to answer any questions you may still have.
from remix.
Thanks @mjackson !
Keep up the good work 👍
from remix.
@mjackson Can I work on this issue?
from remix.
@Anishpras You should ask @kentcdodds. He's the one heading up our documentation efforts. I'm not sure if he'd prefer a separate page about this or what.
from remix.
I think we should have a page under "Guides" called "TypeScript" that describes basically what @mjackson said. @Anishpras, you can go ahead and get things started if you don't mind me making edits to whatever you write :)
from remix.
@kentcdodds Okay! Will start ASAP.
from remix.
@kentcdodds I have opened a PR for the issue discussed above PR 1378.
from remix.
Thanks everyone! https://remix.run/docs/en/v1/guides/typescript
from remix.
Related Issues (20)
- Uncaught SyntaxError: The requested module '/app/root.tsx? does not provide an export named 'Layout' (at root.tsx) HOT 8
- Relative path does not resolve correctly with flat file routes with redirect HOT 5
- [vite] Files shared between Remix and Express are loaded twice HOT 2
- `useRouteLoaderData("root")` returns `undefined` in root's `ErrorBoundary`/`Layout` when non-existent page is loaded right away. HOT 10
- `TypeError: Can't modify immutable headers.` in handleDataRequestRR (Cloudflare Pages) HOT 2
- When use custom routes, pages use `root.tsx` Layout only and skip own by prefix pattern HOT 1
- Vulnerability detected in library Braces
- [Vite] Remix probably serves malformed response HOT 4
- Node Fetch: Cannot cancel a stream that already has a reader HOT 3
- Random preloads added for images HOT 1
- `assetsDir` not properly resolved when using `basename` when using Wrangler HOT 1
- Splat Routes that would have been prioritized can be overridden by Dynamic Segments. HOT 7
- remix hydration error when using gtag
- [Vite] [Cloudflare] dev server start failed with http_proxy environment variable
- Onclick handler not working in remix and problem installing tailwindcss HOT 5
- MetaFunction data type not inferred from clientLoader HOT 3
- Application Error: failed to execute insertBefore on Node HOT 18
- Vitest looks for package.json in every workspace when using vitePlugin HOT 2
- [BUG]: cloudflareDevProxyVitePlugin: Issue in DEV with Remix/Vite/Drizzle/Cloudflare Pages/Supabase/Postgres HOT 2
- Can't import node_module SVG HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from remix.