Skip to content

[react] update packages to TS 2.8 and add library managed attributes#27482

Closed
ferdaber wants to merge 22 commits into
DefinitelyTyped:masterfrom
ferdaber:react/library-managed-attributes
Closed

[react] update packages to TS 2.8 and add library managed attributes#27482
ferdaber wants to merge 22 commits into
DefinitelyTyped:masterfrom
ferdaber:react/library-managed-attributes

Conversation

@ferdaber
Copy link
Copy Markdown
Contributor

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: <>
  • Increase the version number in the header if appropriate.
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }.

Part 2 of this closed PR: #27267. Dependent on #27378.

@ferdaber
Copy link
Copy Markdown
Contributor Author

cc @weswigham

@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Jul 23, 2018

@ferdaber Thank you for submitting this PR!

🔔 @Shearerbeard @asvetliakov @seryl @dijimsta @lstanden @me @jgoz @Asana @vsiao @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar @sulf @Kovensky @MarianPalkus @NoHomey @jwbay @huhuanming @MartynasZilinskas @thovden @Hotell @tkrotoff @nali @knegusen @joscha @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @tinaroh @moshfeu @prokopcm @binki @incleaf @pepaar @stephenjelfs @ilivit @stkb @GiedriusGrabauskas @xbIm @mrk21 @honzabrecka @antonvasin @vittorio @lhache @steller @dborysov @bolatovumar @dawnmist @DovydasNavickas @joshuakgoldberg @coding2012 @samuelneff @grahammendick @dru89 @brikou @jthegedus @resir014 @scottdj92 @joaovieira @Romic @khanhas @Slessi @mleko @alexgorbatchev @nupplaphil @mihe @DenisTirilis @mantasmarcinkus @mattoni @paustint @j-fro @johnnyreilly @Methuselah96 @ssyrell @endigo @ralbuque @prakarshpandey @forabi @crohlfs @nicolas-schmitt @pjo256 @robessog @tbayne @cdeutsch @rosskevin @diogocorrea @gabsprates @varHarrie @bradleyayers @marknelissen @piotrwitek @pikpok @eps1lon @mhegazy @LKay @ssi-hu-antal-bodnar @ianks @flaub @alelode @UJosue10 @Ogglas @Guymestef @radziksh @PaitoAnderson @KostyaEsmukov @mitsuruog @kandros @9renpoto @acemac @trevonmckay @screendriver @velveret @rudi-c @Kimahriman @markspolakovs @mntdn @santiagodoldan @alaatm @samwalshnz @mabels @BernabeFelix @vstrimaitis @stepancar @skirsdeda @David-LeBlanc-git @kittimiyo @SupernaviX @KieranPeat @martinnov92 @Junbong @andrewBalekha @smrq @Rogach @royxue @KoalaHuman @seansfkelley @uncovertruth @ArturAmpilogov @NathanNZ @Sa-ryong @oizie @gustavohenke @cleverguy25 @theruther4d @matdube @LynxEyes @goblindegook @benbayard @codeaid @jurosh @eugrdn @danzel @patsissons @apare @jankarres @alitaheri @senukartur @begincalendar @pushplay @timurrustamov @dublicator @vincaslt @gavingregory @cameron-mcateer @TiuSh @jsonunger @brmenchl @vasilysn @invliD @abirkholz @ZheyangSong @andrewhathaway @grzesie2k @evanbb @isman-usoh @lith-light-g @sammkj @yuit @diogodca @tock203 @chnoch @beheh @danielasy @adamwpc @rhysd @christianchown @sroy3 @Lapanti @psrebniak @bgrieder @cdroulers @gyzerok @tillwolff @bhouser @kristerkari @formatlos @AviVahl @DanielRosenwasser @bendxn @netoisc @spielc @gnestor @iamdanfox @sirreal @iplus26 @KurtPreston @phbou72 @LucianBuzzo @m0a @benjaminRomano @buptyyf @tomshen @odensc @tlaziuk @iMobs @artfuldev @osdiab @rimig @lavoaster @CarlosBonetti @morphologue @bradzacher @marcfallows @tkqubo @drewnoakes @homburg @ttamminen @hallowatcher @peterblazejewicz @dimitarnestorov @alloy @iRoachie @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @a-tarasyuk @ifiokjr @RodrigoAWeber @jacobbaskin @MrLuje @jnbt @suniahk @jmfirth @pocesar @josephroque @VincentLanglet @mindhivefi @connectdotz @plantain-00 @mrand01 @CaiHuan @egorshulga @SahinVardar @gazaret @sivolobov @RookY2K @mhcgrq @kaoDev @fangpenlin @petejkim @phanalpha @charlesfamu @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman @magrinj @TizioFittizio @stigi @DeividasBakanas @sztobar @klaascuvelier @heatherbooker @salim7 @jemmyw @aaronbeall @vitosamson @tbounsiar @igorissen @KennethanCeyer @deevus @wouterhardeman @pegel03 @archy-bold @guilhermehubner @r3nya @istefo @mdibyo @jacoporicare @shuntksh @aghoneim92 @zzanol @thasner @kenzierocks @clayne11 @tansongyang @nicholasboll @pdeva @kallikrein @val1984 @jrakotoharisoa @clementdevos @graphcool @voxmatt @npirotte @ckknight @matthew-matvei @aMoniker @alechill @xaviergonz @Ragg- @fsubal @sergey-buturlakin @vasek17 @ngbrown @awendland @ssorallen @huy-nguyen @grmiade @DaIgeb @neuoy @rraina @pret-a-porter @t49tran @sudoplz @Hesquibet @giladgray @iebaker @vujevits @devrelm @onatm @ninjaferret @tehbi4 @misantronic @darkartur @icopp @naortor @remojansen @jeroenvervaeke @ricokahler @DomiR @charlesrey @pelotom @curtisw0 @jbraithwaite @dan-j @sonnysangha @9y5 @thchia @viccrubs @chrisgarber @kiyopikko @mctep @horiuchi @mxl @psakalo @Havret @danez @matthewberryman @wassname @mykter @arvitaly @lochbrunner @ryprice @cavarzan @zry656565 @kerwynrg - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). The Travis CI build failed labels Jul 23, 2018
@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Jul 23, 2018

@ferdaber The Travis CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@ferdaber
Copy link
Copy Markdown
Contributor Author

@johnnyreilly Travis is failing due to the number of packages changed. The tests are causing an out-of-memory error.

@johnnyreilly
Copy link
Copy Markdown
Member

johnnyreilly commented Jul 23, 2018

Hmmm not sure what to suggest; this is presumably a (regrettable) limitation of our test infrastructure set-up. Is this straightforward to batch up into a number of smaller PRs?

Or feel free to tweak our test infrastructure!

@Jessidhia
Copy link
Copy Markdown
Member

Not really. The overwhelming majority of the changes is bumping the minimum version of the typings to TS 2.8 which is a necessary change because of how the dt publisher works. Unless you mean create a bunch of PRs that do nothing besides bumping version to 2.8.

@weswigham
Copy link
Copy Markdown
Contributor

Aye, you can bump the dependent packages in separate PRs to work around the memory issue.

@Hotell
Copy link
Copy Markdown
Contributor

Hotell commented Jul 23, 2018

Same issue occurred here #26545 and to solve it we had to increase buffer size microsoft/types-publisher#471

@ferdaber
Copy link
Copy Markdown
Contributor Author

I can do that. Going by how many tests were successful before the OOM issue occurred I think two PRs should be sufficient (I can test locally for that). Thanks for the suggestions, y'all!

@tkrotoff
Copy link
Copy Markdown
Contributor

tkrotoff commented Jul 23, 2018

@ferdaber @Hotell

Current Travis CI errors are not related to microsoft/types-publisher#471 (am I missing something here?):

=== ERRORS ===


Error in react
Error: /home/travis/build/DefinitelyTyped/DefinitelyTyped/types/react/test/index.ts:128:9
ERROR: 128:9  expect  TypeScript@next compile error: 
Type 'Validator<Context>' is not assignable to type 'Validator<string | null | undefined>'.
  Type 'Context' is not assignable to type 'string'.
    at /home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/dtslint/bin/index.js:103:19
    at Generator.next (<anonymous>)
    at fulfilled (/home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/dtslint/bin/index.js:5:58)
    at <anonymous>


Error in recompose
Error: /home/travis/build/DefinitelyTyped/DefinitelyTyped/types/recompose/recompose-tests.tsx:255:33
ERROR: 255:33  expect  TypeScript@next compile error: 
Argument of type 'StatelessComponent<InnerProps>' is not assignable to parameter of type 'ComponentType<OutterProps & { count: number; } & { setCount: (state: number) => number; }>'.
  Type 'StatelessComponent<InnerProps>' is not assignable to type 'StatelessComponent<OutterProps & { count: number; } & { setCount: (state: number) => number; }>'.
    Type 'InnerProps' is not assignable to type 'OutterProps & { count: number; } & { setCount: (state: number) => number; }'.
      Type 'InnerProps' is not assignable to type 'OutterProps'.
        Property 'title' is missing in type 'InnerProps'.
    at /home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/dtslint/bin/index.js:103:19
    at Generator.next (<anonymous>)
    at fulfilled (/home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/dtslint/bin/index.js:5:58)
    at <anonymous>
Error: The following packages had errors: react, recompose
    at /home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/types-publisher/src/tester/test-runner.ts:121:8
    at Generator.next (<anonymous>)
    at fulfilled (/home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/types-publisher/bin/tester/test-runner.js:4:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

npm ERR! Test failed.  See above for more details.


The command "npm test" exited with 1.

@ferdaber
Copy link
Copy Markdown
Contributor Author

You're right! I was wondering where the recompose errors went... Regardless I'm going to close this PR when I next work on it and split it otherwise I won't be able to see the actual errors before Travis poops the bed.

@typescript-bot typescript-bot added the Has Merge Conflict This PR can't be merged because it has a merge conflict. The author needs to update it. label Jul 23, 2018
@goloveychuk
Copy link
Copy Markdown

@ferdaber can we add

type StrictifyFunctions<T> = {
  [K in keyof T]: T[K] extends (...args: infer A) => infer R
    ? (...a: A) => R
    : T[K] extends Object ? StrictifyFunctions<T[K]> : T[K]
};

..... StrictifyFunctions<Defaultize<TProps, D>>

This addes correct variance checking for methods.
See microsoft/TypeScript#25451

@weswigham
Copy link
Copy Markdown
Contributor

@goloveychuk forcing strict variance checking on every react consumer is a big break. I wouldn't do it as the same time as this addition.

@typescript-bot
Copy link
Copy Markdown
Contributor

@ferdaber I haven't seen anything from you in a while and this PR currently has problems that prevent it from being merged. The PR will be closed tomorrow if there aren't new commits to fix the issues.

@typescript-bot typescript-bot added the Abandoned This PR had no activity for a long time, and is considered abandoned label Jul 30, 2018
@typescript-bot
Copy link
Copy Markdown
Contributor

@ferdaber To keep things tidy, we have to close PRs that aren't mergeable but don't have activity from their author. No worries, though - please open a new PR if you'd like to continue with this change. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Abandoned This PR had no activity for a long time, and is considered abandoned Has Merge Conflict This PR can't be merged because it has a merge conflict. The author needs to update it. Popular package This PR affects a popular package (as counted by NPM download counts).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants