Skip to content
This repository has been archived by the owner on Sep 9, 2021. It is now read-only.

Revert "Use ES6 import in TypeScript README example" #151

Closed
wants to merge 2 commits into from

Conversation

grind086
Copy link
Contributor

@grind086 grind086 commented Jun 5, 2018

Reverts #140

This syntax causes TypeScript to output incorrect code. worker-loader creates a module like the following:

module.exports = function() {
  return /* factory */
};

To describe this module in TypeScript you would use

declare module moduleName {
  export = /* typeof factory */
}

and to import it you use

import moduleName = require('path/to/module');

This is how I originally wrote the docs. The change assumes that worker-loader uses a module of the form

exports.default = function() {
  return /* factory */
};

and emitted code will attempt to reference the default property of the module, resulting in a TypeError whenever you try to use the module (since the property is undefined).

TypeScript doc reference: https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require

@codecov
Copy link

codecov bot commented Jun 5, 2018

Codecov Report

Merging #151 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #151   +/-   ##
=======================================
  Coverage   66.21%   66.21%           
=======================================
  Files           5        5           
  Lines          74       74           
  Branches       25       25           
=======================================
  Hits           49       49           
  Misses         22       22           
  Partials        3        3

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 12a339d...514cb8a. Read the comment docs.

@codecov
Copy link

codecov bot commented Sep 18, 2018

Codecov Report

Merging #151 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #151   +/-   ##
=======================================
  Coverage   66.21%   66.21%           
=======================================
  Files           5        5           
  Lines          74       74           
  Branches       25       25           
=======================================
  Hits           49       49           
  Misses         22       22           
  Partials        3        3           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 612511d...514cb8a. Read the comment docs.

@alexander-akait
Copy link
Member

Sorry for delay, closing in favor #253, we will update docs in the near future

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

Successfully merging this pull request may close these issues.

2 participants