You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/05/20 18:09:24 UTC

[GitHub] [cordova-plugin-file] mark-veenstra opened a new issue #316: Do not overwrite standard File API

mark-veenstra opened a new issue #316: Do not overwrite standard File API
URL: https://github.com/apache/cordova-plugin-file/issues/316
 
 
   # Feature Request
   
   ## Motivation Behind Feature
   This plugin overwrites standard Web API implementations like:
   
   | Plugin Clobber | Standard Web API |
   | -------------------- | ------------------------- |
   | [`window.File`](https://github.com/apache/cordova-plugin-file/blob/rel/6.0.1/plugin.xml#L49) | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) |
   | [`window.FileReader`](https://github.com/apache/cordova-plugin-file/blob/rel/6.0.1/plugin.xml#L61) | [FileReader](https://developer.mozilla.org/en-US/docs/Web/API/FileReader) |
   | [`window.ProgressEvent`](https://github.com/apache/cordova-plugin-file/blob/rel/6.0.1/plugin.xml#L96) | [ProgressEvent](https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent) |
   
   This causes issues for example with the E2E testing tool Cypress. Specifically the Cypress plugin [`cypress-file-upload`](https://github.com/abramenal/cypress-file-upload/issues/71#issuecomment-493975216), which relies on the default File API implementation.
   
   ## Feature Description
   Do not overwrite the standard API. It seems that the plugin itself using it's own `require` method to include the correct JS file. But the `plugin.xml` file also overwrites the standard Web implementation.
   
   Drawbacks would be that people that are using these exposed overwritten API's would have a problem or need to re-write code. For example expose these Cordova specific API's for the plugin on a different name then the standard API.
   
   For example expose:
   * window.File --> window.cordova.File
   
   
   ## Alternatives or Workarounds
   Alternatives would be that tools like Cypress or any other codebase that needs the standard API include a polyfill to get the standard API back again.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org