decoupled / redwood-core

5 stars 0 forks source link

Pre-render support #7

Open aldonline opened 4 years ago

aldonline commented 4 years ago

Live Preview of Dynamic Pages

  @memo() getRoutePathForFilePath(filePath: string): string | undefined {
    // TODO: params
    const path = this.parent.pages.find((p) => p.filePath === filePath)?.route
      ?.path;
    if (path?.includes("{")) return;
    return path;
  }

Live Build Statistics

- Redwood.js
  - pages
    - / - Home.js
    - /product/{id} - [157] - Product.js 

Note: This will work with the development version of the database by default. Usually, developer databases have less data, which makes this feature less interesting. It would be really cool to allow developers to "connect" to a production version of redwood for additional data, which can then be shown in context during development.