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

feature: drop dependencies to improve runtime performance #230

Open
jantimon opened this issue Jul 29, 2020 · 1 comment
Open

feature: drop dependencies to improve runtime performance #230

jantimon opened this issue Jul 29, 2020 · 1 comment

Comments

@jantimon
Copy link
Contributor

jantimon commented Jul 29, 2020

lodash is used for very trivial checks:

if (!_.isString(input)) {

if (_.isUndefined(encoded)) {

if (!_.isString(url)) {

if (_.isString(input) && input.length > 0 && CSS_TOKEN.test(input)) {

maybe we can remove lodash to reduce the amount of security warnings poping up for lodash

@jantimon
Copy link
Contributor Author

jantimon commented Jul 31, 2020

I did some further research and saw that we could probably also remove the xss code with the https://www.npmjs.com/package/dompurify npm package

This would remove also the following sub dependencies:

  • parse5 & xregexp & sanitizer & node-esapi

In sum that would save 50% of the runtime code (highlighted with blue):
savings

@jantimon jantimon changed the title feature: drop lodash feature: drop dependencies to improve runtime performance Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant