Comments (2)
Thanks for the detailed overview! It was not my intention to trigger that much work with my seemingly small question. Sorry.
To elaborate my vote in favor of named exports, some additional comments:
-
Regarding Pro-default 2
I think this argument is a bit historic as default was the earlier option. I think this point should be removed from the list or even be moved to the con-default list. Here's why:
where you can change the name
You can also rename named exports like e.g.
import { instantMeiliSearch as whatIWant } from 'instant-meilisearch'
. Refactoring would then rename instantMeiliSearch but not the local name whatIWant.Also, given the package is already installed, with Named exports I could just type
instantM
(or even less), get the autocompletion (from vscode, in my case) which then automatically adds a named import (or extends an existing one, if something else from the package was already imported).If I'm missing the import but have a snippet pasted from somewhere like basic usage example from the readme, it would underline the method name and provide the autofix to add a named import. I think it does not do that for default exports (at least it didn't for
axios
which I just tried it with.)Concluding this bullet, I'd consider named exports easier to use than default and would just cross that point from the pro-list.
-
Another con-default:
If there's a reason later to export another function, this would be very easy with named exports, but not with default exports.
-
Another pro-default:
- changing it now would be breaking change (but the earlier, the better?)
Here's another list of arguments against default export (some of which have already been mentioned), from @basarat's book TypeScript Deep Dive: https://basarat.gitbook.io/typescript/main-1/defaultisbad
from meilisearch-js-plugins.
Closed by: #238
from meilisearch-js-plugins.
Related Issues (20)
- Sorting with _geoPoint splits coordinates into two arrays at the comma (instant-meilisearch) HOT 3
- Create algolia-search-request and algolia-search-response packages
- Search on facet values when sorting HOT 3
- useDynamicWidgets HOT 3
- hierarchicalMenu on multiple attributes filters only on first attribute HOT 1
- Expose search parameters intuitively, specifically the important ones (`attributesToHighlight`, `attributesToCrop`, …) HOT 9
- Error when choosing a facet containing quotation marks (`"` character) HOT 3
- Expose both created `MeiliSearch` instance, and the used `meilisearch` package HOT 1
- Query with special character (`"`) is not filtering correctly HOT 5
- Prevent duplicate requests HOT 1
- Error: The `searchClient` must implement a `search` method. HOT 5
- Warning: Module 'cross-fetch/polyfill' Not ESM in Angular Build HOT 2
- Multiple queries in one instantsearch request HOT 1
- Sarafi webkit: SyntaxError: Invalid regular expression: invalid group specifier name (js-regexp-lookbehind) HOT 4
- Wrong facet count with many facets HOT 1
- Error when specifying sort parameter in MeiliSearch Angular integration HOT 1
- Support hybrid search HOT 4
- Range Slider problems HOT 1
- Infinite loop error when using the transformItems prop from InstantSearch's Menu component HOT 1
- multiple snippets from various parts of the document
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 meilisearch-js-plugins.