Comments (5)
Hi @mfix22! Would it suffice to import codemirror-graphql/mode
?
from codemirror-graphql.
We are going to use it in the browser (obviously) so we just want the import to be as small as possible.
Right now if we import codemirror-graphql/mode
will only the one package get included? That might be out of the scope of this issue (:
@asiandrummer, I would just like to import this function, the one passed to CodeMirror.defineMode
(:
from codemirror-graphql.
@mfix22 -
I would just like to import this function, the one passed to CodeMirror.defineMode
I take that you'd like to import the mode function, as well as the required imported modules that include CodeMirror
and graphql-language-service-parser
.
$ du -hcs node_modules/codemirror
3.2M ../codemirror
$ du -hcs node_modules/graphql-language-service-parser
84K ../graphql-language-service-parser/
$ du -hcs node_modules/codemirror-graphql
116K ../codemirror-graphql
$ du -hcs node_modules/codemirror-graphql/mode.js
4.0K ../codemirror-graphql/mode.js
So if we just released, let's say codemirror-graphql-mode
only, then we'd save around 100K (LICENSE/README/package.json takes up 12K in my calculation). Since in any case you'd have to import CodeMirror
that is ~3200K already, I'd say you're not saving much.
I understand that I may not be familiar with your situation though - may I ask what your use case is? Is ~100K addition enough to hinder the performance in your web application? I'm willing to consider releasing said codemirror-graphql-mode
if it's absolutely necessary under a good business use case. cc @wincent I'd like to get your input as well please!
from codemirror-graphql.
It would be desirable to tackle this at the build stage, I think: if you directly require "codemirror-graphql/mode" (and only that), you would ideally be able to bundle only that and its dependencies (which as @asiandrummer points out, are quite large). If there is some technical obstacle to that in how codemirror-graphq is structured, we should fix it (although I am not aware of any issues), but I don't think creating a separate package should be necessary.
from codemirror-graphql.
Hey guys after further thought, I am going to close this. Every scenario where I would like to use that function is for CodeMirror
-y things, in which case I will already have to import CodeMirror. Thanks for the discussion!
from codemirror-graphql.
Related Issues (20)
- Use `graphql-language-service-parser` instead HOT 1
- Support for schema shorthand notation HOT 4
- Code in 0.6.3 version on the npm is quite different with the code on the github HOT 4
- Upgrade graphql-language-service-interface to 0.7.0 HOT 3
- Where is [email protected] source code? HOT 1
- When will you publish 0.6.4? HOT 5
- The autocomplete doesn't show any description HOT 8
- Getting a TypeError when rendering GraphiQL HOT 1
- automatically fills in leaf nodes HOT 6
- Problem with IDEOGRAPHIC SPACE (\u3000) HOT 3
- Should peer dependency on graphql be OK with graphql 0.11.x? HOT 4
- Please publish v0.6.12 to npm HOT 1
- please enable graphql v13 as peer dependency HOT 7
- How to bring graphql schema from server to client? HOT 1
- Support `null` value for field arguments HOT 1
- URL param to open docs panel? HOT 1
- Add fragment suggestion HOT 3
- `TypeCondition` and `Directive' aren't optional in InlineFragments HOT 1
- make codemirror-graphql to support graphql 0.8.0-b as a peer dependency
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 codemirror-graphql.