Cypress: Request a reference TypeScript plugin plainly on top of TypeScript compiler

Created on 12 Feb 2019  路  4Comments  路  Source: cypress-io/cypress

Current behavior:

Originated from discussion in aurelia/cli#1029
To write cypress tests in TypeScript, currently there are two official reference plugins using webpack and browserify respectively.

https://docs.cypress.io/guides/tooling/typescript-support.html#Transpiling-TypeScript-test-files

Desired behavior:

Webpack and browserify are not the only choices to build a SPA. When webpack/browserify are not used in the toolchain, there is no clear way how to support writing cypress tests in TypeScripts.

It looks like cypress has no runtime dependency on either webpack or browserify. So I suggest to build another reference TypeScript plugin plainly on top of TypeScript compiler. The new reference plugin is not only more generic, but also should be able to totally replace existing webpack/browserify plugin.

Versions

N/A

wontfix typescript

Most helpful comment

@chrisbreiding correct me if I'm wrong but the cypress-webpack-preprocessor is already a repo owned/maintained by Cypress. So I don't really get the notion of saying a "simple" tsc based preprocessor shouldn't be a core dependency as well.

The current setup forces the consumer of Cypress to either bet on Browserify or Webpack, which granted is a broad range of use-cases but certainly not all, looking at Parcel, RequireJS, SystemJS and all the hundreds other solutions. The baseline option to provide a low-level support for all TypeScript projects would actually be a minimalistic tsc preprocessor and let the user care about bundling with whatever tool is preferred.

I think it's of high interest that this tsc-preprocessor is hosted/maintained by Cypress due to trust/quality reasons. It speaks a whole different language if you own the preprocessor vs having it as a community project.

All 4 comments

I think we could write our own "simple" TypeScript transpiler using just tsc programmatically, right @chrisbreiding

Absolutely, the preprocessors API exists to facilitate just that. I don't think we need to own/maintain that though. I'd like to see created in userland.

@chrisbreiding correct me if I'm wrong but the cypress-webpack-preprocessor is already a repo owned/maintained by Cypress. So I don't really get the notion of saying a "simple" tsc based preprocessor shouldn't be a core dependency as well.

The current setup forces the consumer of Cypress to either bet on Browserify or Webpack, which granted is a broad range of use-cases but certainly not all, looking at Parcel, RequireJS, SystemJS and all the hundreds other solutions. The baseline option to provide a low-level support for all TypeScript projects would actually be a minimalistic tsc preprocessor and let the user care about bundling with whatever tool is preferred.

I think it's of high interest that this tsc-preprocessor is hosted/maintained by Cypress due to trust/quality reasons. It speaks a whole different language if you own the preprocessor vs having it as a community project.

I agree with @zewa666 but I'm willing to try and see if I could get a preprocessor working based on the TS API. Sounds like a nice challenge/learning experience. It might be a while before I have time to start/finish.

Was this page helpful?
0 / 5 - 0 ratings