microsoft / microsoft/BotFramework-WebChat

Remove deprecated code related to activity middleware

Open
#4,365 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
HTML
Stars
1.8k
Forks
1.6k
Avg merge
22h 58m
Merged PRs (30d)
2

Description

(This is a continuation work of #4362)

Feature Request

activityRenderer, activityStatusRenderer, and attachmentRenderer props

The deprecation period of activityRenderer, activityStatusRenderer, and attachmentRenderer props is up on 2022-06-15. We should remove them to simplify our code.

nextVisibleActivity

The deprecation period of nextVisibleActivity is up on 2022-07-22. We should remove nextVisibleActivity to simplify our code.

While removing the nextVisibleActivity, also clean up some of our samples to make sure:

() => next => ({ activity, nextVisibleActivity }) => {
  return next({ activity, nextVisibleActivity });
}

To become:

() => next => (...args) => {
  return next(...args);
}

This clean up make sure activity middleware is upgradeable.

Move to freezeArray from Object.freeze() for some typed arrays

With the ordinary Object.freeze, it types out as by generalizing types for all items.

Object.freeze(['abc', 123]); // (number | string)[]

With freezeArray, it does not generalize types for all items.

freezeArray(['abc', 123]); // [string, number]

[feature-request]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating references to activityRenderer, activityStatusRenderer, attachmentRenderer, nextVisibleActivity, and Object.freeze in the activity middleware and sample code. Check the related work in issue #4362, then verify that deprecated props and middleware arguments are removed, samples use pass-through arguments, and the affected typed-array behavior is covered by the existing tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.