-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Client side routing with multiple entrypoints #4142
Comments
Please fill out the template. It's useful to know e.g. your parcel version and other things asked in the template. |
It's a simple enough question, consider this question applicable to all versions of Parcel or the current, whichever bypasses the bureaucracy. There's literally zero nuance. |
Client side routing is supported by default? Not entirely sure what the real bug is, unless you haven't actually tried it yet. |
For multiple entrypoints? |
Not for multiple entrypoints, at least not on Parcel 1. In Parcel 2 it can fallback to index.html, client side routing usually only really happens for spa's and once you have multiple entrypoints you really no longer have an spa |
That seems like an arbitrary principle. I have multiple SPAs (login + signup, consent screens, app itself) Could it not be possible to always serve entrypoints when they are explicitly in the path? |
I've never seen anyone do that before but sure it's possible |
Well, currently it's not as parcel won't redirect to entrypoints when there are multiple. I don't think it's at all unusual to need this. All applications can benefit from reusing the things they have in common. |
I meant it's technically possible and can be added to parcel not that it's currently possible without using a seperate dev server. Anyway gonna flag this as a feature |
Not sure I'm talking about the same problem, but if I have 2 htmls: index.html
admin/
index.html And using: parcel src/index.html src/admin/index.html --no-cache --no-autoinstall --open In devserver I'm only served the first index.html (bundled), to access the admin I have to go to Current (This breaks serving 2 SPA):
Expected:
Is this known and expected? |
@damianobarbati that's probably how it should work, haven't really paid that much attention to this issue anymore as it wasn't 100% clear what the bug or actual solution is/would be. Gonna fix that in a bit so it behaves like you mentioned. Seems fairly straightforward and simple to implement. |
I didn't want to put pressure on this, but it would be great indeed. 🙂 I'm currently working it around developing with 2 different commands (and switching every time, painful). Thanks for the effort @DeMoorJasper 💪 |
🐛 bug report
(I think this problem description is simple enough that the full template is a bit overkill.)
I'm running with multiple entrypoints on the dev server, when an HMR reload is triggered, I get a 404 because it attempts to resolve the exact path (something like
/myapp.html/some/route
) rather than simply serving/myapp.html
and allowing the client-side routing to take over for the/some/route
portion.Is this supported currently?
The text was updated successfully, but these errors were encountered: