-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch from rollup to vite, from commonjs to ecmascript modules #1740
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1740 +/- ##
==========================================
- Coverage 97.81% 97.80% -0.01%
==========================================
Files 17 16 -1
Lines 1465 1461 -4
Branches 307 306 -1
==========================================
- Hits 1433 1429 -4
Misses 32 32 ☔ View full report in Codecov by Sentry. |
"typings": "./dist/types/index.d.ts", | ||
"types": "./dist/types/index.d.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EXPLAINER: These are no longer required, as exports
below contains the types, and TypeScript primarily looks there.
"main": "./dist/bundles/meilisearch.cjs", | ||
"module": "./dist/bundles/meilisearch.mjs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EXPLAINER: "exports"
is the replacement for these and we no longer officially support Node.js versions prior to 18, so we do not need the backwards compatibility.
a83e48d
to
bb95a1c
Compare
Pull Request
Related issue
Fixes #1626
Waiting on #1739What does this PR do?
rollup
tovite
, which internally usesrollup
, but makes things a lot shorter and simplervitest.config.js
scripts/file-size.js
, packageskleur
,pretty-bytes
,brotli-size
,gzip-size
, as it prints sizes by defaultrollup
plugins and dependencies (@rollup/plugin-terser
,@babel/core
,@babel/preset-env
,@rollup/plugin-babel
,@rollup/plugin-commonjs
,@rollup/plugin-json
,@rollup/plugin-node-resolve
,rollup-plugin-typescript2
)shx
package, andcleanup
script, as it clearsdist
itself"type": "module"
).js
project file now needs to be written in ESM syntax, the web standard syntaxtsconfig.json
according to https://www.typescriptlang.org/docs/handbook/modules/guides/choosing-compiler-options.html#im-writing-a-librarymodule
tonode16
andverbatimModuleSyntax
totrue
, this requires changes to all TypeScript files so they may be compatible with the web standard ESM.js
extensionindex
directory imports, as that is only a Node.js thing, the web doesn't support ittype
keywordCaution
Old
New
Caution
window
/global
/globalThis
/self
with the exports, instead it extends it with propertymeilisearch
which contains the exportsOld
New
PR checklist
Please check if your PR fulfills the following requirements:
Thank you so much for contributing to Meilisearch!