Closed brillout closed 10 months ago
It’s intuitively understood by everyone that a custom config overrides a default config. It’s pretty much a standard.
Sometimes it’s the things we think about at first that are the best solutions, because that will also be what others intuitively think first. :-)
Tailwind had that problem with theme replacing the default config instead of modifying it, they sure had a lot of questions because people weren't used to the extend
prefix.
Not sure how much the extend prefix could be useful here, although it doesn't seem to me that it's really a config, the current state of the meta parameter looks to me more like route props than a config itself.
If I'm not wrong with the above thought, I'd say meta is better than extendConfig or customConfig, although in that sense I think props
would be a better name.
Just saw this. It gives some precedence and inspiration:
https://remix.run/docs/en/main/file-conventions/remix-config#routes
remix.config.js
A function for defining custom routes, in addition to those already defined using the filesystem convention in app/routes. Both sets of routes will be merged.
The V1 design is out of beta and now the official design.
The
vite-plugin-ssr@1.0.0
design in a nutshell:I.e.
+config.js
replaces.page.js
,.page.server.js
,.page.client.js
, and.page.route.js
.It also replaces
_default.page.js
as well as VPS configurations set invite.config.js
:VPS's architecture stays the same and therefore migration is relatively simple.
Succint syntax
Under consideration is the possibility to create new pages in a succint manner:
Here, a new
+config.js
file isn't needed each time a new page is created.I'm currently leaning towards not supporting such succint syntax (in favor of "Single Config File", see next section). But I may reconsider if users want this.
Single Config File (aka Single Route File)
The
singleConfigFile
enforces the entire app to be defined in that single+config.js
file. This means that this single+config.js
file represents the entire interface between VPS and your app.Nested Views
(Aka "Nested Layouts", but "Nested Views" is a better name for this design.)
This example doesn't use
singleConfigFile
(otherwisenested
would be defined in/pages/+config.js
instead).Custom Exports
The V1 design requires Custom Exports to be registered.
More
The V1 design unlocks many more capabilities, in particular around building frameworks on top of VPS. See end of this comment.
This is a very exciting design. (In many subtle ways, you'll see when you'll use a VPS framework.)
Feedback
(Negative) feedback welcome.
Acknowledgement
🙏 @AaronBeaudoin for the fruitful conversation.