microsoft / microsoft/AdaptiveCards

sideEffects: false causing esbuild treeshaking to remove Carousel and Table

Open
#9,138 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
2k
Forks
595
Avg merge
1d 19h
Merged PRs (30d)
1

Description

The adaptivecards package incorrectly has sideEffects set to false in the package.json

https://github.com/microsoft/AdaptiveCards/blob/66f566186ce579ea302f2be397f7da920ec4c24e/source/nodejs/adaptivecards/package.json#L17

This results in several elements, such as carousel and table, not working because of tree shaking in esbuild.

There's a workaround available by doing the following:

import * as AC from 'adaptivecards';

export class App {
  #ac = AdaptiveCards;
}

Minimal repro:
Repro, broken
Repro, workaround

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 at source/nodejs/adaptivecards/package.json, especially the sideEffects entry, and reproduce the issue using the linked broken and workaround StackBlitz examples. Confirm that carousel and table continue working after esbuild tree shaking; the package metadata should no longer cause those elements to be removed.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.