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

Remove legacy contextTypes #4997

Merged
merged 9 commits into from
Jul 18, 2024
Merged

Remove legacy contextTypes #4997

merged 9 commits into from
Jul 18, 2024

Commits on Jul 4, 2024

  1. Remove legacy React contextTypes

    This removes some legacy api deprecation notices in the console in
    React 18.
    
    - Replace the last this.context.router in projectSettings.es6 with
      this.props.router from withRouter HOC. (Tested this, works fine)
    
    - Remove these, which are unused:
    
          SomeComponent.contextTypes = {
            router: PropTypes.object
          };
    p2edwards committed Jul 4, 2024
    Configuration menu
    Copy the full SHA
    3000ea5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6dbcace View commit details
    Browse the repository at this point in the history
  3. reactBemComponents .es6 -> .tsx

    Doing this step in one commit, hoping it will make the diff easier to
    review online.
    p2edwards committed Jul 4, 2024
    Configuration menu
    Copy the full SHA
    17e8759 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5b3c6f9 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1995b1a View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2024

  1. Install eslint-plugin-import for separate type import statements…

    e.g., not say 'duplicate import' for this code:
    
       import React from 'react'
       import type { ReactNode } from 'react'
    
    …which used to work fine, but typescript-eslint's no-duplicate-imports
    rule has been removed:
    
    - typescript-eslint/typescript-eslint@47eeea9275bd
    - https://typescript-eslint.io/rules/no-duplicate-imports/
    
    We could do more with this plugin.
    
    Only skimmed it, but some of the other features might require some
    more config.
    
    - https://github.com/import-js/eslint-plugin-import/blob/main/README.md#resolvers
    
    (Meanwhile, I'll try not to think about how many dev dependencies
    we bring in just for this cool rule.)
    p2edwards committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    ad79423 View commit details
    Browse the repository at this point in the history
  2. Refinements after testing KoboMatrix

    - Remove modifier='[object Object]' in generated bem elements
    - Use the new React 18 root API in renderInBackbone
    p2edwards committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    e4056df View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2024

  1. Merge pull request #5000 from kobotoolbox/eslint-type-duplicate-imports

    Update ESLint config to accept separate type imports in TS again
    magicznyleszek authored Jul 17, 2024
    Configuration menu
    Copy the full SHA
    bd881d9 View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2024

  1. Configuration menu
    Copy the full SHA
    78e1ece View commit details
    Browse the repository at this point in the history