Hey folks, I discovered, by accident, a weird issue today, it’s described below, with a repo that shows the error, does this sound and looks like a good issue to be opened in github? Or would it just create noise.
I’m willing work on it to try to fix it, would need someone to point me in the right direction as this would be my first framework contribution.
Also I don’t really know who to create tests for it.
Description of the issue
If you have two private routes on the same line with one space in between your application will break.
It’s not picked up by prettier, so they stay on the same line.
If multiples spaces are inserted between the two routes prettier will reduce them to only one space.
If no spaces are in between the routes, prettier will put the second route in a new line, fixing the problem.
The spaces behave the same way in "public routes, but the app doesn’t break.
Examples
this will break your app :
<Router>
<Route path="/signin" page={SigninPage} name="signin" />
<Private unauthenticated="signin">
{/* two private routes on the same line? 🚨🚨🚨🚨🚨 */}
<Route path="/secret" page={SecretPage} name="secret" /> <Route path="/dashboard" page={DashboardPage} name="dashboard" />
</Private>
{/* two public routes on the same line? ✅✅✅✅✅ */}
<Route path="/" page={HomePage} name="home" /> <Route notfound page={NotFoundPage} />
</Router>
this works :
<Router>
<Route path="/signin" page={SigninPage} name="signin" />
<Private unauthenticated="signin">
<Route path="/secret" page={SecretPage} name="secret" />
<Route path="/dashboard" page={DashboardPage} name="dashboard" />
</Private>
{/* two public routes on the same line? ✅✅✅✅✅ */}
<Route path="/" page={HomePage} name="home" /> <Route notfound page={NotFoundPage} />
</Router>
Glad to hear! 'Cause I still feel guilty for that “30 min demo” == 1 hour. Anyway, you were a champion and it really helped the process to have you be included. So thanks again.