scottohara / tvmanager

PWA for tracking recorded, watched & upcoming TV shows
MIT License
3 stars 0 forks source link

istanbul-instrumenter-loader doesn't support optional catch bindings #93

Closed scottohara closed 2 years ago

scottohara commented 4 years ago

https://github.com/webpack-contrib/istanbul-instrumenter-loader/issues/96

If we can't commit to the offer to take over maintenance of the entire istanbul-instrumenter-loader project, another option would be to create our own fork that just bumps the dependency version.

scottohara commented 4 years ago

Also doesn't support optional chaining (foo?.bar)

Example: dataSync-controller_spec.ts, find specs:

scenarios.forEach((scenario: Scenario): void => {
  describe(scenario.type ?? "invalid sync type", (): void => {

Had to change to:

scenarios.forEach((scenario: Scenario): void => {
  describe(null === scenario.type ? "invalid sync type" : scenario.type, (): void => { 
scottohara commented 3 years ago

Investigate switching to https://github.com/JS-DevTools/coverage-istanbul-loader

The README indicates:

Coverage Istanbul Loader is based on Istanbul Instrumenter Loader, but uses a newer version of the Istanbul API and has better support for source maps.

The current loader is configured as:

{
    test: /\.(?:t|j)s$/u,
    loader: "istanbul-instrumenter-loader",
    options: {
        esModules: true
    },
    exclude: /node_modules/u,
    enforce: "post"
}

The alternate loader appears to support the same config, so it should be a drop-in replacement.

scottohara commented 2 years ago

DataDog appear to have confirmed this works with webpack 5:

https://github.com/DataDog/browser-sdk/pull/1020