question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make it possible to import small modules of the library independently

See original GitHub issue

If we want to ship extra modules, like query diffing, that aren’t always included, there are only two ways I know to make that work with today’s bundlers:

  1. Ship every part as a separate NPM package: import diffQueries from 'apollo-diff-queries';
  2. Ship multiple files in the NPM package: import diffQueries from 'apollo-client/diff-queries';

I currently prefer the second because it will make testing and version management much easier, plus it doesn’t require people to install a bunch of packages. But to do it we have to move the files before publish to put them in the right place (they have to be in the root of the published package I think).

I’m happy to implement this so that we can start cracking on some of the stuff in: https://github.com/apollostack/apollo-client/issues/157#issuecomment-216401284

Looking for feedback from @jbaxleyiii, the tooling and publishing mastermind.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
stubailocommented, May 3, 2016

Sounds great!

I’ll just add stuff in src then and assume it will be importable eventually.

0reactions
stubailocommented, May 4, 2016

I think this is done since import gql from 'apollo-client/gql' works great!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Modules: Creating, Importing, and Sharing - Stack Abuse
One important aspect when writing modular Python apps is locating the modules that need to be imported. While modules of the standard Python ......
Read more >
Python import: Advanced Techniques and Tips
Use modules, packages, and namespace packages; Handle resources and data files inside your packages; Import modules dynamically at runtime; Customize Python's ...
Read more >
6. Modules — Python 3.11.1 documentation
Such a file is called a module; definitions from a module can be imported into other modules or into the main module (the...
Read more >
Importing Modules - Python 3 Notes
In this video tutorial, we learned how to import a Python script you yourself created as a module and re-use the functions you...
Read more >
How To Make Tree Shakeable Libraries - Theodo blog
Create an application module tree by looping through all the dependencies and sub dependencies imported by the entry file; Identify for each ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found