Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

boot-server.tsx no longer compiles with TypeScript 2.4 (React + Redux template) #1034

@chris-nissen

Description

@chris-nissen

Title

boot-server.tsx no longer compiles with TypeScript 2.4 (React + Redux template)

Functional impact

When webpacking in prod env mode, projects will fail TypeScript compilation. I'm not sure if any of the other templates are affected, but I expect they would be.

Minimal repro steps

  1. dotnet new reactredux
  2. Update the version of typescript to "2.4.0" in package.json
  3. npm install
  4. node node_modules/webpack/bin/webpack.js --env.prod

Expected result

Successful compilation.

Actual result

TS2345: Argument of type '(params: BootFuncParams) => Promise' is not assignable to parameter of type 'BootFunc'.
Type 'Promise' is not assignable to type 'Promise'.
Type 'RenderResult' is not assignable to type 'RenderToStringResult'.
Type 'RedirectResult' is not assignable to type 'RenderToStringResult'.
Property 'html' is missing in type 'RedirectResult'.

Further technical details

I think this can be fixed by updating the BootFunc interface like so:

interface BootFunc {
    (params: BootFuncParams): Promise<RenderToStringResult | RedirectResult>;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions