Giter Club home page Giter Club logo

Comments (9)

iagobruno avatar iagobruno commented on August 28, 2024 1

You don't need to separate into multiple packages, it's unnecessary complexity for the maintainer, just separating into subfolders solves the problem:

import { typeDef, resolver } from 'graphql-scalars/URL'
import { typeDef, resolver } from 'graphql-scalars/PhoneNumber'

from graphql-scalars.

dburles avatar dburles commented on August 28, 2024 1

Why is the package bundled? Don't bundle it and allow consumers to deep import the parts they need. That way we're not needlessly loading 3000+ lines of source code into memory just for the sake of a single scalar.

from graphql-scalars.

ardatan avatar ardatan commented on August 28, 2024 1

All scalars are treeshakable. You can use a bundler like webpack if the bundle size is important for you.
We're still open for PRs for more :)
I think it is already small;
https://bundlephobia.com/package/[email protected]

from graphql-scalars.

dburles avatar dburles commented on August 28, 2024 1

Of course, but the other benefit is that consumers won't be required to bundle and tree-shake.

from graphql-scalars.

ardatan avatar ardatan commented on August 28, 2024

We already have this. You need to import ‘SomeDefinition’ and ‘SomeResolver’ for example.

from graphql-scalars.

ravangen avatar ravangen commented on August 28, 2024

I was meaning separate NPM packages. For example, there is lodash and lodash.merge. I am aware I don't need to import everything from the graphql-scalars module.

I thought it could be a nice to have feature request, obviously not critical. This "issue" can stay closed regardless. Seemingly this package will grow to encase a variety of scalars, and this would enable being more selective about what dependencies are actually necessary to support each scalar.

from graphql-scalars.

ardatan avatar ardatan commented on August 28, 2024

@ravangen We can keep it open :) Sorry for misunderstanding. That would be a nice feature

from graphql-scalars.

ardatan avatar ardatan commented on August 28, 2024

@ravangen @httpiago This package is already tree-shakable so do you have a specific case needs that kind of feature?

from graphql-scalars.

ravangen avatar ravangen commented on August 28, 2024

We can close this, I don't think it is worth any extra process overhead on the maintainers.

I had been using lodash the other day and had simply thought that their option to use separate micro packages was a nice feature. 90% of these scalars don't apply to my current uses cases.

from graphql-scalars.

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.