Comments (8)
Would there be some benefits to expose the replacement function as a named export instead of default export?
I don't know. Would there be? You're the one asking.
from figures.
Just to make sure, are you suggesting the following: moving the function to a named export called replaceSymbols(), and keep the default export, but only for the figures (not for that function)?
Correct.
Actually, I think we can just move to ESM. My big ESM is in a month, but we can start early. I have a lot of modules to go through. Since we're doing a breaking release anyway.
from figures.
Are there some PRs from your other repositories I could use as example? This would streamline both the implementation and the review.
sindresorhus/manage-wifi@89dfe25
sindresorhus/debounce-fn@e07dc3f
from figures.
In my opinion, having a variable that is both a function and a "traditional" object might have some drawbacks:
- This can be confusing for some users.
- It can come with some surprise if the user is checking for the variable type (for example with
is-plain-obj
) - This can lead to some unexpected behavior when copying the variable. For example
{...var}
would keep the object properties, but not the function, whilevar.bind()
would do the opposite. - This can complicate TypeScript types.
On the other side, some users find default exports simpler than named exports.
Overall, I think using a named export is more proper, but I was curious what your thoughts on this were?
from figures.
Even if we moved the replacement function to a named function, the rest should still stay a default export (I will move to ESM soon, so having both will not be a problem).
I don't feel strongly about this. Any suggestion on the name for the replacement function? replaceSymbols()
?
from figures.
replaceSymbols()
sounds good
Just to make sure, are you suggesting the following: moving the function to a named export called replaceSymbols()
, and keep the default export, but only for the figures (not for that function)?
from figures.
Sounds good.
Are there some PRs from your other repositories I could use as example? This would streamline both the implementation and the review.
from figures.
This was released in https://github.com/sindresorhus/figures/releases/tag/v4.0.0.
from figures.
Related Issues (20)
- Transpile to ES5 HOT 1
- cucumber-js breaks on IE11 because of IE11 incompatible syntax HOT 1
- The new Windows Terminal have good Unicode support. HOT 1
- Please consider exporting `main` & `windows` HOT 5
- Display single-character percentages on Windows HOT 2
- Add figures for subscript numbers HOT 2
- Add figures for some common mathematical symbols HOT 2
- Add figures for musical notes HOT 2
- Add figures for triangles and lozenges HOT 3
- Add figures for box lines HOT 6
- Add figures for fill characters HOT 4
- Add documentation about all cross-platform terminal characters HOT 2
- Do not show identical figures in `readme.md` HOT 2
- Linux kernel console support HOT 2
- cmder support HOT 5
- xterm support HOT 4
- Main `cross` character is incorrect HOT 3
- Fallback symbols are not covered by tests in Unicode-capable environments, including CI HOT 4
- TypeError: Cannot read properties of undefined (reading 'tick') HOT 1
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 figures.