Comments (9)
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.
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.
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.
Of course, but the other benefit is that consumers won't be required to bundle and tree-shake.
from graphql-scalars.
We already have this. You need to import ‘SomeDefinition’ and ‘SomeResolver’ for example.
from graphql-scalars.
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.
@ravangen We can keep it open :) Sorry for misunderstanding. That would be a nice feature
from graphql-scalars.
@ravangen @httpiago This package is already tree-shakable so do you have a specific case needs that kind of feature?
from graphql-scalars.
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)
- Add Custom Scalars for Common Library Classification Codes HOT 1
- [Feature Request] Add International Patent Classification scalar type HOT 1
- Stop DateTime auto converting to UTC HOT 2
- Project Roadmap
- GraphQLScalarType TInternal and TExternal are unknown HOT 1
- BigInt is Breaking HOT 4
- Positive BigInt HOT 1
- Create a package for recommended GraphQL Scalars client types HOT 1
- Docs - missing scalars (DateTimeISO, LocalDateTime, probably more) HOT 3
- Add support for Kosovo country code `XK`
- Support GeoJSON types HOT 1
- Incompatible with GraphQL v15 & Typescript HOT 4
- Date and DateTime Validation HOT 1
- Unix timestamps are not serialized correctly for scalar DateTime HOT 1
- Latitude and Longitude types are inconsistent w/ graphql-codegen
- Project Roadmap
- Support for Swedish Personal Number (Personnummer) HOT 1
- Minor misspelling in RoutingNumber error message
- Project Roadmap
- JSONObject: Unexpected error if literal is not an object
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-scalars.