Skip to content

Commit

Permalink
Smalla adjustments to the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitAverty authored Dec 8, 2021
1 parent 14f396f commit 9c1873f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = {

and have this in the route-template.tsx file :

```javascript
```typescript jsx
import {json, Link, LoaderFunction, useLoaderData} from "remix";

// Almost normal route module
Expand Down Expand Up @@ -79,7 +79,7 @@ and it should work.
Currently, if you want similar behaviours at different urls you have two solutions :

- Extract the common logic in functions and components and wire them in different route modules (that limits what you can extract and it's a little verbose)
- Have a single route module that match several urls (but you're restricted on what URLs you use, and the logic to infer parameters based on the url can get complicated)
- Have a single route module that match several urls (but you're restricted on what URLs you use, and the logic to infer options based on the url can get complicated)

What I propose gives a third option that I think is better in some cases

Expand All @@ -106,9 +106,6 @@ Take a look at the `blog-route-package` folder and imagine it's a package publis

const {registerBlog} = require("blog-route-package/register");

/**
* @type {import('@remix-run/dev/config').AppConfig}
*/
module.exports = {
async routes(defineRoutes) {
return defineRoutes(route => {
Expand All @@ -130,4 +127,4 @@ I think this could be great to add Authentication, complex register/forgot passw

For the "routes package", take a look at the `blog-route-package` folder and imagine it's published on NPM.

The implementation of the `buildRouteModule` function is in `route-module-builder/moduleBuilder.js` file. I plan to publish this to npm, but to have a really good developer experience it need to be integrated to remix. That could make live-reload work when templates are changed, and also avoid the `app/.generated` folder that I need to make because remix only accepts route modules inside the app folder.
The implementation of the `buildRouteModule` function is in `route-module-builder/moduleBuilder.js` file. I plan to publish this to npm, but to have a really good developer experience it need to be integrated to remix. That could make live-reload work when templates are changed, and also avoid the `app/.generated` folder that I need to make because remix only accepts route modules inside the app folder.

0 comments on commit 9c1873f

Please sign in to comment.