Giter VIP home page Giter VIP logo

Comments (5)

whymarrh avatar whymarrh commented on May 18, 2024

From a quick scan, it looks like the following functions are used from the _ module:

  • _.each
  • _.extend
  • _.clone
  • _.countBy
  • _.defaults
  • _.groupBy
  • _.pick

That's a fair bit of functionality that would need to be replicated by another module?

from pa11y.

stephenmathieson avatar stephenmathieson commented on May 18, 2024

not replicated by another module, but other modules. this is just my personal ocd, but smaller modules tend to perform better.

from pa11y.

rowanmanning avatar rowanmanning commented on May 18, 2024

Something to consider, if you have any suggestions for replacement modules @stephenmathieson? I'm not going to focus heavily on this kind of optimisation (if needed at all) until the adding of new features has settled down a bit – from past experience, trying to optimise while everything's changing under your feet is a painful task.

I'll pop this on the back-burner for now, and will revisit after the next release.

from pa11y.

stephenmathieson avatar stephenmathieson commented on May 18, 2024

this is definitely not a big deal, and certainly shouldn't block other more important changes from making their way into the codebase. i agree that if this sort of path is to be followed, it can wait.

regarding replacements:

  • _.each = [].forEach or for (var prop in obj) fn(prop, obj[prop]) or Object.keys(obj).forEach
  • _.extend = utils.extend or for (var prop in obj) new_obj[prop] = obj[prop]
  • _.clone = [].slice.call or utils.extend({}, obj) or clone
  • _.defaults = _.extend = utils.extend = ...

for methods like _.pick and _.groupBy, i'd have to suggest a slight refactor (or at least a deeper examination as to why these methods are needed)

from pa11y.

rowanmanning avatar rowanmanning commented on May 18, 2024

Reading over this again, I might revisit the dependencies at some point but underscore is working fine for now. If I was to move away from underscore, it would be towards several small modules which replace the different functions being used. I wouldn't like to reimplement the functionality in this repo as it would increase the complexity and amount of code we'd have to test/maintain.

from pa11y.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.