fresh icon indicating copy to clipboard operation
fresh copied to clipboard

Extensibility — how can a dependency inject a route in a project's manifest?

Open drawveloper opened this issue 2 years ago • 2 comments

Hi! First, thank you all for the great work in fresh and deno. It makes me happy to code again :)

I'm building a live site editor based on fresh and so I would like to configure some features for my framework-powered projects. Think of it as a meta-framework for fresh.

For example, I have built an utility to inspect DOM elements in the browser and open VSCode directly on correct source/line/column. https://github.com/deco-cx/inspect-vscode

I would like a way to inject the /inspect-vscode in a fresh manifest without having to ask the user to copy a file into routes/inspect-vscode.ts. My point is that this is not authored by my user and they shouldn't have it "clutter" their repo.

@lucacasonato any thoughts on this usecase? I'd like a way to let a user "install a lib" and have it inject some routes, islands, etc. Perhaps something a la express app.use(myFeature()), in spirit?

drawveloper avatar Jul 16 '22 02:07 drawveloper

Yes, this is something I'd like to eventually add support for via plugins (#512).

lucacasonato avatar Jul 30 '22 15:07 lucacasonato

I'm also interested in this, the lack of a way to dynamically add routes, islands, middleware was leaning me away from fresh for a personal project. I'd be happy to help with this effort though

Are there open thoughts on how to best implement this or which feature to start with since the render one is merged? I didnt see other open issues or PRs with discussion on this in general aside from the roadmap

contra1337 avatar Sep 03 '22 02:09 contra1337