Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
scottohara opened this issue Jan 25, 2020 · 3 comments
Closed
Labels

Comments

@scottohara
Copy link
Owner

webpack-contrib/istanbul-instrumenter-loader#96

  • optional catch binding not supported until instanbul-lib-instrument@2.2.0
  • version in instanbul-instrumenter-loader@3.0.1 is ^1.7.3
  • for now, added (_e) to each affected catch block

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
Copy link
Owner Author

scottohara commented Jun 8, 2020

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
Copy link
Owner Author

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
Copy link
Owner Author

DataDog appear to have confirmed this works with webpack 5:

DataDog/browser-sdk#1020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant