about
about copied to clipboard
List third party code usage
Context: The website tested on the slow side for Interaction to Next Paint, which is often affected by third-party code. We will review to either limit or remove the scope of scripts that aren’t necessary.
To do: List the marketing scripts we use on the website.
Here is the GitStart Ticket for this issue: https://clients.gitstart.com/sourcegraph/3436/tickets/SGM-6777
Description
- List all third party code usage in the codebase.
Refs
To be kept
@dotlottie/react-player: playing dot-Lottie animations on theenterprisepage@headlessui/react: designing theDropdowncomponent@visx/*building visualization componentsclassnames: joining style rules togetherd3-scaleis a peer dependancy@visx/scaled3-time-formatfor date formatting D3-* are built on top of d3 library which is kind of huge, it will be better to keep them the way they arefeed: generating feedsframer-motion: animating a video, it was used on thecarouselcomponentglobby: a helper for globbing files. It's used to generate cachegray-matter: parsing front-matter from the MD filesjs-cookie: saving login initialization state for SSOmdi-react: For icons. Since most of icons are imported from this library, the@heroicons/reactcan be removed and migrate completely to this one.next-mdx-remote: loading MDX contentsprism-themes,prismjs: used for the syntax highlightingrehype-autolink-headings,rehype-pretty-code,rehype-slug, andremark-gfmare peer dependencies ofnext-mdx-remotesharp: It's recommended in production for Image Optimization with Next.jsshikijiis a peer dependency ofrehype-pretty-code
Duplicated libraries
@heroicons/react: It can be removed and replaced withmdi-reactsince it's the one that's used the most
To be built internally
d3-format: trimming insignificant trailing zeros across the data displayed on graphs. There is a small usage for this, we may consider building it internal using different logic since if we use the same logic as the library we will have to use a lot of code for simple use.react-popper: for creatingTooltipcomponent.usePopperis the only item imported from the library. I believe we can copy the implementation from its repo and get rid of the library.rxjs: Can be removed. We only importnoopfunction which can be built internally
Unused 3rd Party Packages
@popperjs/core: Can be removed. It has been used to provide a data type in thesrc/components/Tooltip.tsxfile which can be built internallylottie-web: Can be removed. It's used in thesrc/components/LottiePlayer.tsxcomponent which it's not used anywhere
Hi @fabicastp We have listed the dependences above.
@gitstart-sourcegraph , as a follow up to this task, can we please remove lottie-web based on your recommendation? We can consider it a new task.
lottie-web: Can be removed. It's used in the src/components/LottiePlayer.tsx component which it's not used anywhere
I think we can close this, @gitstart-sourcegraph ! I'll open a new task for the request in the comment above.