-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for remix.config.ts
#438
Add support for remix.config.ts
#438
Conversation
Hi @jensmeindertsma, Welcome, and thank you for contributing to Remix! Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once. You may review the CLA and sign it by adding your name to contributors.yml. Once the CLA is signed, the If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run. Thanks! - The Remix team |
Thank you for signing the Contributor License Agreement. Let's get this merged! 馃コ |
packages/remix-dev/config.ts
Outdated
); | ||
} | ||
|
||
let temporaryFile = path.resolve(os.tmpdir(), "_remix.config.js"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would cause problem if you write path.join(__dirname, './some-path')
in your config, __dirname
will be the tmpdir.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could also generate a _remix.config.js file in the project root just temporarily, then unlink it immediately. Would that be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I do that I might not need the bundle option either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you do need the bundle option since you might import
another ts file in your config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could probably generate the temporary file in the project root instead, then __dirname would still work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe check out https://github.com/egoist/bundle-require/blob/main/README.md#how-it-works, it's how Vite loads vite.config.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I might use that instead. Hand rolling my own solution is likely going to cause some problems down the line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 馃榿
Let me know if there's anything I can do to help get this merged 馃槉 |
ab9dac4
to
172ecc9
Compare
Thanks Jens. We don't want to add the complexity and a new dependency right now, the remix config is pretty basic. (You might want to check your editor to make sure it's using the project's prettier config because this PR has a bunch of formatting changes in unrelated files.) |
Would you accept this PR if it didn't add any new dependencies ( just use |
I don't care how basic is it, this is a bad call, IMO. Maybe not this PR, but is there any way we can get the concept of a |
If you're reading this you may want to check out https://github.com/donavon/remix-patches and the |
It would be lovely if this were revisited, given that the config potentially includes writing functions to define custom routes and things of that nature. Not to rehash why typescript even exists, but doing that in pure JS is painful and buggy. Got bit by this last night. |
Hello 馃憢.
I love using Remix, and what better way to show than to implement support for a feature I'd really love to see in Remix? It's a minor change but one that I quite like.
This pull requests implements support for
remix.config.ts
in addition to the existingremix.config.js
. Writing your config files in TypeScript can be nice for projects which try to use as much TypeScript as possible, it increases the confidence you can have that your app still works after a dependency change. It also provides autocompletion ( I'm aware JSDoc also does this ). It also updates thegists-app
fixture to verify that this feature works. Please let me know if you'd prefer to see this fixture change be reverted and would rather see a new fixture app created for this feature.Thanks for all the awesome work on Remix! 馃檹