GithubHelp home page GithubHelp logo

Comments (4)

alex-randall avatar alex-randall commented on June 11, 2024

Wondering if we should not expose these util methods outside the library publically (and just use them internally) since there might be some overlap with other libraries out there.

Or... maybe a select few functions in it should be public?

from pnp-js-core.

pbjorklund avatar pbjorklund commented on June 11, 2024

I like having some of them exposed for doing things that are clunky. However I think they should be exposed via their own classes instead of through a 'Util' class (most obvious crime against separation of concerns)

from pnp-js-core.

patrick-rodgers avatar patrick-rodgers commented on June 11, 2024

Where possible I want to avoid referencing other libraries since it would force a consumer to also include that lib to use ours. The dateAdd is there because I needed something for the cache expire stuff. I don't really want to handle dates universally. IsFunction is similar, we need that test and it takes up three lines, so I prefer not to take a dep to get three lines of code. Some of the other util methods are there because they are things I have used regularly in the past and were part of the js core from which this was derived. getRansomString forex I often use when creating dynamic DOM elements that need an ID. Always want to keep the conversation going on what makes sense vs. what doesn't, but I am OK with what we have currently.

We do currently expose them through pnp.util on the root object which simulates a class to the consumer.

from pnp-js-core.

patrick-rodgers avatar patrick-rodgers commented on June 11, 2024

Going to close this issue - I think we are in agreement that we need to limit the utility code we write, while keeping a focus on not taking dependencies for a few lines of code in some other library. In other words I think take what we absolutely need to make our library work. Then folks can use whatever they want outside that in their projects.

from pnp-js-core.

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.