Use tsc to compile files and stop bundling with webpack
Use tsc to build the library. I think it could be done without introducing a breaking change by keeping the webpack build alongside BUT I don't think it is a good idea because each symbol/interface/type would be exported twice:
- once in the bundle (
import {client} from "@logilab/cwclientlibjs"
) - and once in the transpiled file (
import client from "@logilab/cwclientlibjs/client"
)
I don't think it would cause any problem with interfaces, which use structural typing, but for classes, which commonly use nominal typing, I think it could cause hard to debug errors (which could happen when combining the two imports mode):
// lib1.d.ts
import {client} from "@logilab/cwclientlibjs/client"
export declare function dataFetcher(rqlClient: client.CwRqlClient) : any
// MyApplication.ts
import {dataFetcher} from "lib1";
import {client} from "@logilab/cwclientlibjs"
const rqlClient = new client.CwRqlClient(...);
dataFetcher(rqlClient) // Probable compile error here
That's why I think we should choose to introduce this change in rql v2.