-
Notifications
You must be signed in to change notification settings - Fork 17
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
Autodiscover simple routes? (without dynamic parts) #40
Comments
Sure, it’s designed so you can plug in whatever strategy you want. I think
that would make a good standalone library.
…On Sun, Jul 7, 2019 at 5:24 AM Alex Kanunnikov ***@***.***> wrote:
Is it possible to use "prember" for simple cases with 0 config?
Routes discovering logic may be taken from
https://github.com/wackerservices/SitemapAutogenerator/blob/master/blueprints/sitemap-autogenerator/index.js
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#40?email_source=notifications&email_token=AACN6MT3ZRHFFD42R2LMSYDP6GY5TA5CNFSM4H6VHHZKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G5WJ43Q>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACN6MTXGBNILGEHDJZ37OTP6GY5TANCNFSM4H6VHHZA>
.
|
Just discovered this package (very cool btw) and thought I would comment in a relevant issue. As a newbie to this package, I think: why do I have this supply a list of routes? The router already has a list of routes. Now I need to keep two trees in sync. It would be awesome if it just took my existing routes (our app is entirely static). Is there some autodiscover function I can use to easily take every existing route? |
It's not the default because it really depends heavily on your use case. Most apps have at least some routes with dynamic segments, which we would either need to ignore (which might be really surprising when people think they're getting all routes prerendered) or error (which would be annoying, because we'd need to offer a configuration system for configuring things explicitly to override the error). I do think somebody absolutely should ship the strategy you're talking about as a library, and I will link it from the README with an example. It shouldn't take users more than two lines to integrate a URL discovery library with prember. |
I agree our use case is nonstandard. I also agree that it would be nice if it's a 2 liner config for those who have this use case. I am very interested in doing things with the Router object in general for my use case. Definitely going to dig into this - also check source code of related projects - and come back later when I have something to contribute. |
So, I took a good look at this, and just posting my code in case someone has a similar problem.
This code is a component, that when called will output a copy-pastable list that can be pasted into the Now, the next step is to return this array directly in ember-cli-build.js in a smart manner, but my Ember knowledge is not good enough for this. Note that I am depending on an undocumented API here. So YMMV. |
Is it possible to use "prember" for simple cases with 0 config?
Routes discovering logic may be taken from https://github.com/wackerservices/SitemapAutogenerator/blob/master/blueprints/sitemap-autogenerator/index.js
The text was updated successfully, but these errors were encountered: