Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

[Feature]: Make Remix extendable #1145

Closed
ronnetzer opened this issue Dec 19, 2021 · 1 comment
Closed

[Feature]: Make Remix extendable #1145

ronnetzer opened this issue Dec 19, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@ronnetzer
Copy link

ronnetzer commented Dec 19, 2021

What is the new or updated feature that you are suggesting?

Currently, extending and wrapping Remix is impossible without being required to copy and overwrite some of the public & private methods. The problematic areas are:

  1. remix config
    Currently you can't get the final RemixConfig without an existing remix.config.js file. Refactoring readConfig to receive AppConfig as parameter will make it possible to get the full config programmatically.
    Another part that is problematic is defineConventionalRoutes which there's no way to tell it to ignore some file that do match routeModuleExts. I would expect it to use the tsconfig's include/exclude props.
  2. compiler
    Although the build and watch methods are exported from the compiler, there are some hard coded values that makes it impossible to extend it. I suggest a refactor to also expose the final configurations that will be used in esbuild.build.
    Also moving the part of getting the external from the package.json to be received as parameter will also make it easier to extend (NX for example uses a complicated calculation to get the relevant dependencies and devDependencies of a project in the monorepo)

Why should this feature be included?

A good use case for this is adding postCSS support as part of the build process instead of having different npm scripts that needs to be ran before the build itself (and also forcing you to generate build files in your src because its needed before the build)

In my specific case, I'm creating an NX plugin that adds support for remix. currently I had to "hard copy" some of remix private methods in order to override some of the configuration, im also forced to generate some files before the build itself in the source directory. this also makes it impossible for me to use the existing NX methods and build processes because NX uses webpack.

If I had the final configurations available, I can use them as part of esbuild-loader in the generated NX's webpack config (i might need to convert the plugins to be compatible with webpack so it might be wise to consider refactoring them as well & decouple them from esbuild

Related Issues

@ronnetzer
Copy link
Author

Just saw that version 1.1.0 added ignoredRouteFiles which is very helpful although I would still expect remix to take the tsconfig into consideration when looking for files.

@machour machour added the enhancement New feature or request label Mar 18, 2022
@remix-run remix-run locked and limited conversation to collaborators Apr 19, 2022
@chaance chaance converted this issue into discussion #2911 Apr 19, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants