vaadin / vaadin-connect

A Vaadin Labs experiment with a secure stateless communication framework
https://vaadin.com/labs/vaadin-connect
Apache License 2.0
18 stars 5 forks source link

Make it more clear that ...serverSideRoutes should be added after client-side routes #432

Closed haijian-vaadin closed 4 years ago

haijian-vaadin commented 4 years ago

As a developer, when creating routes in TypeScript, I might end up adding ...serverSideRoutes before client-side routes, e.g.

const routes = [
 {
   path: '/',
   component: 'main-layout',
   children: [
     ...serverSideRoutes,
     {
       path: '/locations',
       component: 'locations-view',
       action: async () => {
         await import('./src/locations-view');
       }
     },
   ]
 }
];

It compiles, but the client-side routes will be ignored, because of (.*) path of the serverSideRoutes. It might take a developer long time to figure why the client-side routes don't work.

DoD:

  1. In the generated index.ts file, state clearly the ...serverSideRoutes should be added at the end and why.
  2. In the Documentation page, also mention...serverSideRoutes should be added at the end and why