Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[typescript] Constrain props type param appropriately in withStyles, withTheme, withWidth HOCs #11003

Merged
merged 17 commits into from
Apr 17, 2018

Commits on Apr 12, 2018

  1. Rewrite withStyles definition, using Omit

    My experience is that the current `withStyles` declaration works poorly with Typescript 2.8.  
    I'm not sure that it's the compiler version that's the issue, though.
    At least in my usage, it fails to remove `WithStyles<ClassKey>` from the return type.
    
    This definition works better in my experience, doesn't rely on subtle inferencer behavior in the same way, and seems to be in the mainstream of current usage.  
    
    There's a built-in `Exclude` function in Typescript 2.8 that does what `Omit` does.
    I used `Omit` for compatibility with older compilers.
    estaub authored Apr 12, 2018
    Configuration menu
    Copy the full SHA
    e1f809d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f488adf View commit details
    Browse the repository at this point in the history

Commits on Apr 13, 2018

  1. Use preferred style in tests

    estaub committed Apr 13, 2018
    Configuration menu
    Copy the full SHA
    3560ac0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8eb517a View commit details
    Browse the repository at this point in the history

Commits on Apr 14, 2018

  1. Configuration menu
    Copy the full SHA
    175fa49 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    92bee1b View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2018

  1. Commit for review and suggestions; DOES NOT COMPILE.

    Remove commented-on code from withStyles;
    use ConsistentWith typewrapper;
    add SFC test for withWidth
    add FAILING test for doc scenario 2 (withStyles of union)
    estaub committed Apr 16, 2018
    Configuration menu
    Copy the full SHA
    c01d787 View commit details
    Browse the repository at this point in the history
  2. Redefine with* to remove Omit.

    Trim obsolete doc.
    Rename "decorate" function to "withMyStyles" in doc.
    Remove redundant failing tests added to clarify Omit problem.
    estaub committed Apr 16, 2018
    Configuration menu
    Copy the full SHA
    89d2a60 View commit details
    Browse the repository at this point in the history
  3. Bring back explicit generic parameter on union case in test, doc.

    In package.json, up-rev Typescript to >2.6.2, and print Typescript
    version in "typescript" run command.
    estaub committed Apr 16, 2018
    Configuration menu
    Copy the full SHA
    bcbf701 View commit details
    Browse the repository at this point in the history
  4. Rename withMyStyles back to decorate.

    Use single quotes in test.
    In package.json, revert typescript to 2.6.1, remove version-printing run command
    In package.lock, revert typescript to 2.6.1.
    estaub committed Apr 16, 2018
    Configuration menu
    Copy the full SHA
    9fbbbc1 View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2018

  1. Configuration menu
    Copy the full SHA
    e66b8ea View commit details
    Browse the repository at this point in the history
  2. Fix package.json, yarn.lock.

    estaub committed Apr 17, 2018
    Configuration menu
    Copy the full SHA
    0b47fb3 View commit details
    Browse the repository at this point in the history
  3. Remove newline from typescript doc.

    estaub committed Apr 17, 2018
    Configuration menu
    Copy the full SHA
    748af39 View commit details
    Browse the repository at this point in the history
  4. Remove needless Omit imports.

    estaub committed Apr 17, 2018
    Configuration menu
    Copy the full SHA
    b24250b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ac934c1 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f1dbf16 View commit details
    Browse the repository at this point in the history
  7. Remove comment from styling-comparison.spec.tsx

    estaub committed Apr 17, 2018
    Configuration menu
    Copy the full SHA
    ea20df9 View commit details
    Browse the repository at this point in the history