Giter Club home page Giter Club logo

Comments (8)

angus-c avatar angus-c commented on May 22, 2024

Can you be more specific? Do you mean logic to check the incoming arguments, or using something like typescript or flow? Or do you mean something else?

from just.

parthshah1991 avatar parthshah1991 commented on May 22, 2024

I am using typescript with angular 2. So I did import the module, but it requires 'typings' for the same.
Hence was asking, whether you'll be supporting it.

It is a type description of all the methods. Can check lodash, node for reference.

from just.

mightyiam avatar mightyiam commented on May 22, 2024

Yup. TypeScript types. Would like them, as well. I am looking for an alternative to lodash.keyBy, exactly because its typings seem unsatisfactory to me. just-index seems like what I'm looking for, but it has no typings.

I think the easiest and most fail-safe way to have typings is to rewrite in TypeScript. But that is radical and if the developer is fond of TypeScript he would have done it by now, probably.

from just.

angus-c avatar angus-c commented on May 22, 2024

Would adding Just here be a workaround? https://github.com/DefinitelyTyped/DefinitelyTyped

from just.

mightyiam avatar mightyiam commented on May 22, 2024

Yup. It would. I never did that, but I imagine it to be quite meticulous and error prone. I seriously don't know how types are manually made for codes as complex lodash, for example. But they are. I bet there are some tips and tricks that come with experience. Seems a bit overwhelming to me. That's why I would suggest converting to TypeScript and letting the compiler produce correct typings for the project.

from just.

angus-c avatar angus-c commented on May 22, 2024

I would consider a TypeScript rewrite if I was already transpiling. One of the biggest benefits of writing Just in ES5 (and without dependencies) is I don't need a transpiler. This is invaluable in terms of import cost, debuggability and predictability.

from just.

mightyiam avatar mightyiam commented on May 22, 2024

No kind of pressure from me at all here, @angus-c. Just sharing that from my experience with TypeScript, it contributes to predictability.

Debugging involves source maps, if you wish. But you could always turn them off and debug the end product. Since you're not interested in down-transpilation from new to old ES, then the end product is pretty much the source minus the types.

from just.

angus-c avatar angus-c commented on May 22, 2024

Yeah I get that (and have used source maps a lot in other projects. I love ES2015+, it's just liberating not to use it in the case of this project since it gives me much more control over performance and size, versus deferring to babel) and I do agree that TS doesn't add transpile bloat, unlike babel/webpack.

One further consideration, I've added a lot of manual type checks for arguments which I would have to keep in addition to TS annotations since many won't be using Just in TS apps.

from just.

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.