Approach to importing in web/ folder makes it complicated to use the files without needless dependencies
See original GitHub issueHi, following what one of my users of React-PDF reported in wojtekmaj/react-pdf#183, I’d like to ask you if there’s no better way of importing utils than via the following line:
import { createPromiseCapability } from 'pdfjs-lib';
This is an example from ui_utils.js. If I happen to use ui_utils.js somewhere (in my case by using pdf_link_service.js), it causes the whole, big tree of imports to be created just to get this one function out. If that file imported createPromiseCapability
directly from util.js
, there wouldn’t be a problem - just one function would be imported where it should, without side effects.
Do you think that’s something that could be solved?
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Imports - Terragrunt - Gruntwork
Define all the code for the single environment in a single file. Implement globals in a way that can be shared across the...
Read more >Getting error "The file does not contain any projects to import"
If you have any missing dependencies error, you will need to import these custom dependencies manually from the repository folder.
Read more >How to import an existing directory into Eclipse?
Then right click on the source folder and choose Import... ->General->File system then choose your files, and it will make a copy of...
Read more >3 Common Tasks — The Yocto Project ® 4.1.999 documentation
Create a Layer Configuration File: Inside your new layer folder, ... The method does not work so well for those new to the...
Read more >Top 10 Mistakes That Django Developers Make - Toptal
Django is a free and open source Python web framework that helpfully solves common ... 2: Not Pinning Project Dependencies in a requirements.txt...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For the last 2.5 years I’ve been hoping that pdf.js would be able to function as a typical node.js package that bundles itself up for the browser using either browserify or webpack. That would probably mean that there are additional subprojects for each of those bundling techniques (or just let me worry about that and to supply my own core-js, etc). I find that pdf.js doesn’t work correctly whatever I do and I end up spending 1-2 days on each major upgrade. I have to try a lot of very hacky stuff to get any results. It seems like there is requirejs (AMD?) stuff, wepback stuff but built with gulp. If I try to source the pdf.js source libraries directly in webpack then I’ll have problems. To some up, I’m quite impressed with pdf.js as a technology but the packaging is just weird, difficult and problematic. The changes over the recent versions are just different kinds of weird, difficult and problematic.
I’ll happily untangle more modules. 😃