javascript icon indicating copy to clipboard operation
javascript copied to clipboard

Slim down on dependencies

Open mcmxcdev opened this issue 1 year ago • 2 comments

Preliminary Checks

  • [X] I have reviewed the documentation: https://clerk.com/docs
  • [X] I have searched for existing issues: https://github.com/clerk/javascript/issues
  • [X] I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
  • [X] This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.

Reproduction

Publishable key

Description

Looking at the package.json below, Clerk pulls in various dependencies that can probably be dropped nowadays: https://github.com/clerk/javascript/blob/50b4176a1b8acfaff691a10ae55597834c90ce53/packages/clerk-js/package.json#L63-L68

  • copy-to-clipboard is a one liner nowadays with navigator.clipboard.writeText()
  • core-js and regenerator-runtime are polyfill compatibility layers that most developers with modern tech-stacks don't care about
  • qs can be replaced with native URLSearchParams API
  • probably more

Expected behavior: Project should be kept as slim as possible

Actual behavior: End users of Clerk have to download and install more deps, which can have CVEs and require more disk space and install time.

Environment

System:
    OS: Linux 6.5 Ubuntu 23.10 23.10 (Mantic Minotaur)
    CPU: (16) x64 AMD Ryzen 7 5800H with Radeon Graphics
    Memory: 17.57 GB / 30.71 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.volta/tools/image/node/20.11.0/bin/node
    Yarn: 1.22.22 - ~/.volta/tools/image/yarn/1.22.22/bin/yarn
    npm: 10.2.4 - ~/.volta/tools/image/node/20.11.0/bin/npm
    pnpm: 8.14.1 - ~/.volta/tools/image/pnpm/8.14.1/bin/pnpm
  Browsers:
    Brave Browser: 123.1.64.109
    Chrome: 123.0.6312.58
  npmPackages:
     "clerk-sveltekit": "^0.4.1"c

mcmxcdev avatar Mar 27 '24 02:03 mcmxcdev

Hello @mcmxcdev Thank you for this feedback. Indeed, it seems we can reduce the dependencies, so we will create a ticket and assign the appropriate priority. In the meantime, if you are interested in contributing to ClerkJS we are open for PRs.

Resources:

  • https://github.com/clerk/javascript/blob/main/docs/CONTRIBUTING.md
  • https://github.com/clerk/javascript/blob/main/docs/CODE_OF_CONDUCT.md

dimkl avatar Mar 28 '24 12:03 dimkl

I appreciate the openness to my suggestions! I will consider creating some PRs if I can manage to find the time.

mcmxcdev avatar Mar 28 '24 14:03 mcmxcdev