Sharlaan / material-ui-superselectfield

multiselection autocomplete dropdown component for Material-UI
https://sharlaan.github.io/material-ui-superselectfield
MIT License
266 stars 92 forks source link

Add type definitions #94

Closed FDiskas closed 6 years ago

FDiskas commented 6 years ago

Closes #91

Sharlaan commented 6 years ago

Can you update or remake this PR or rebase, this time based on new master branch please ?

codecov-io commented 6 years ago

Codecov Report

Merging #94 into master will decrease coverage by 1.1%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
- Coverage   42.07%   40.97%   -1.11%     
==========================================
  Files           6        6              
  Lines         202      205       +3     
==========================================
- Hits           85       84       -1     
- Misses        117      121       +4
Impacted Files Coverage Δ
src/defaultProps.js 53.84% <0%> (-4.49%) :arrow_down:
src/utils.js 36% <0%> (-3.14%) :arrow_down:
src/SuperSelectField.js 38.84% <0%> (-0.33%) :arrow_down:
src/FloatingLabel.js 22.22% <0%> (ø) :arrow_up:
src/SelectionsPresenter.js 100% <0%> (ø) :arrow_up:
src/types/index.js 33.33% <0%> (+2.56%) :arrow_up:

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 4a72665...04b90b7. Read the comment docs.

FDiskas commented 6 years ago

Useless codecov comment. Anybody knows how to turn off commenting on pull requests?

Sharlaan commented 6 years ago

One question: Have you tried installing and using both the es5 and module versions of material-ui-superselectifled, on a dummy page featuring react/react-dom/material-ui ?

I'm asking this following your modification of package.json properties "main" and "module".

FDiskas commented 6 years ago

I tried to npm run build and that index.js was missing :poodle: Logic is simple.

Sharlaan commented 6 years ago

If you read NWB documentation as suggested few days ago, you would have learn that : lib/ contains the es5 version, transpiled es/ contains the module-compatible version, by extension untranspiled since module import is last EcmaScript feature implemented into nowadays browsers so this means :

  1. you MUST include these folders in npm publish
  2. index.js allows the browser JS engine to get all needed files (reminder they are splitted !) by default So if you rename this file browser won't import properly

There is a third build, it were the original form of my project before this transfer to NWB: the UMD. In this particular build case, yea all component files are concatenated into one. We didnot include this one, es5 and module versions should be enough for most projects.

FDiskas commented 6 years ago

You should check the results after pre released https://unpkg.com/material-ui-superselectfield/ and check the "main" section in package.json

Sharlaan commented 6 years ago

What your link is pointing at, is a "UMD" build. As explained above, we decided to ditch this in favor of es5 and es6+ module versions...

FDiskas commented 6 years ago

Yes link is pointing to the latest npm module version. Try publishing the new version of current refactored environment. You will see some changes. And the "main" section of package.json will be wrong. And yes - got the point what you talking about. But keep in mind that by using UMD is a good way to test for users your component for example in jsbin.com

FDiskas commented 6 years ago

@Sharlaan any news about this?

FDiskas commented 6 years ago

DO something. Can't wait and fix merge conflicts to often

KnisterPeter commented 6 years ago

Added support for prop-types: https://github.com/KnisterPeter/react-to-typescript-definitions/issues/439#issuecomment-346266699

FDiskas commented 6 years ago

cool :jeans:

FDiskas commented 6 years ago
Conflicting files
package-lock.json

so why I'm not using npm any more. Use yarn instead :)

FDiskas commented 6 years ago

Note definitions should not be committed. They must be generated on each build.

I'm right?