Restructure source so that individual functions can be imported w/o importing the entire source
See original GitHub issueRight now, if you want to import just one function in bip39
you must import the entire bundle. This can add unnecessary code to already large apps, making them larger. I propose that each function be written in their own files so that they can be imported independently of one another.
My specific concerns here are the the unorm
dependency and words list files, which are quite large and not required for all of these utility functions.
Note: I plan to PR this repo with this change, but am open to thoughts in the meantime 😃
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
pytest cannot import module while python can - Stack Overflow
I am a bit puzzled, it looks like this indicates an import error, but Python does it fine so why is there a...
Read more >Python import: Advanced Techniques and Tips
In Python, you use the import keyword to make code in one module available in another. Imports in Python are important for structuring...
Read more >Easier Code Organization - Beginning Elm
When we import a module without exposing anything inside it, it's called a qualified import. That means we have to prefix all functions,...
Read more >Importing Python Functions from Other Scripts | by Katy Hagerty
Compared to the copy-and-paste method, the import method makes it much easier to reuse functions. Lines of code are not accidentally dropped. Additional...
Read more >Programming FAQ — Python 3.11.1 documentation
Contents: Programming FAQ- General Questions- Is there a source code level debugger with ... How can I have modules that mutually import each...
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
ES6 exports/imports, combined with tree shaking would make this irrelevant.
I think I’d sooner recommend that path then splitting up the source code unnecessarily when it nearly fits on 1 page.
In an ideal world, everything might be a module. But in an ideal world, we might not even need to write code! Alas, I think breaking this file into mini-files of 10 lines hurts maintenance for something so small, therefore, NACK for that change alone.