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.

v2: Make a decision on casing for the default export

See original GitHub issue

TinyColor vs tinycolor:

The lowercase variation is the v1 API, so keeping that would make migration easier. The camel cased variation is more typical for class naming.

This mostly just affects UMD users and how we write it in documentation if we go with something like https://github.com/bgrins/TinyColor/pull/181 where we do a default export for node.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bgrinscommented, Aug 14, 2018

Yeah, I’ve gone back and forth. I’m also leaning lowercase for now since that’ll make migration from v1 to v2 seamless for most cases. I actually wish it was camel case to match the project name, but I think there’s value in uncoupling that potential name change from getting v2 shipped.

0reactions
scttcpercommented, Aug 19, 2018

i think we should keep it showing new because it is still a class.

I do think some of the readme examples no longer work?

import { fromRatio } from 'tinycolor2';

might not be working anymore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the benefit of prefer-default-export? #1365 - GitHub
With default exports, you lose refactoring power (if you rename the source const / function / class , it won't rename default imports)....
Read more >
Change: Prefer default export to no default export (#20) · Issues
There will not be a decision to make between single-export and multiple-export modules. All modules will export named exports, ...
Read more >
What is export default in JavaScript ? - GeeksforGeeks
Default Exports: Default exports are useful to export only a single object, function, variable. During the import, we can use any name to...
Read more >
Default Exports in JavaScript Modules Are Terrible - Reddit
Heck for your use case you can still forgo default export: simply import with “* as” then iterate the import object if you...
Read more >
ts-transform-default-export | Yarn - Package Manager
Whether to throw when there are named exports in the module along with the default one. This is important because when a default...
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