-
Notifications
You must be signed in to change notification settings - Fork 14
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
chore(javascript): use tsup bundler #3640
Conversation
✔️ Code generated!
📊 Benchmark resultsBenchmarks performed on the method using a mock server, the results might not reflect the real-world performance.
|
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.
this is huuuge, congrats !
@@ -226,6 +226,10 @@ jobs: | |||
if: ${{ startsWith(env.head_ref, 'chore/prepare-release-') }} | |||
run: cd clients/algoliasearch-client-javascript && yarn test:size | |||
|
|||
- name: Test JavaScript bundle and types | |||
if: ${{ startsWith(env.head_ref, 'chore/prepare-release-') }} | |||
run: cd clients/algoliasearch-client-javascript && yarn test:bundle |
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.
lovely
...getBaseConfig(cwd), | ||
platform: 'browser', | ||
format: ['esm'], | ||
target: ['chrome109', 'safari15.6', 'firefox115', 'edge126'], |
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.
ie
is also a valid target, don't you want to include it ?
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.
The enum for target are prefixes actually, if you don't give a precise version for browsers it asks for it at runtime
@@ -12,7 +12,8 @@ | |||
"release:bump": "lerna version ${0:-patch} --no-changelog --no-git-tag-version --no-push --exact --force-publish --yes", | |||
"release:publish": "tsc --project scripts/tsconfig.json && node scripts/dist/scripts/publish.js", | |||
"test": "lerna run test $*", | |||
"test:size": "bundlesize" | |||
"test:size": "bundlesize", | |||
"test:bundle": "lerna run test:bundle --verbose --skip-nx-cache --include-dependencies" |
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.
why the skip cache everywhere ? on the build step too ?
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.
nx and lerna was still in an early phase when I set it up and there wad cache issues, I guess it's legacy but we should be able to remove it as on the ci there's always no cache
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.
we could cache the .nx folder on the CI
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.
idk how flaky it is but yup maybe
@@ -1,2 +1,2 @@ | |||
// eslint-disable-next-line import/no-unresolved | |||
export * from './dist/lite/builds/node'; | |||
export * from './dist/lite/node'; |
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.
can you delete this template and just create the d.ts file directly pls ?
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.
This allows adding a new client without touching the js repo normally, if we remove those it means documenting to add them etc... it's easier that way
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.
some files already need to be copied manually, I think we will just copy the package if we add a new spec
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.
some files already need to be copied manually
true but ideally you'd just add your spec and that's it
module.exports = require('./dist/lite/builds/node.cjs'); |
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.
same
@@ -1,2 +1,2 @@ | |||
// eslint-disable-next-line import/no-unresolved | |||
export * from './dist/{{#isAlgoliasearchClient}}algoliasearch/{{/isAlgoliasearchClient}}builds/node'; | |||
export * from './dist/node'; |
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.
same
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.
nothing to add, gg !
Co-authored-by: Clément Vannicatte <[email protected]>
algolia/api-clients-automation#3640 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
After this release, the umd build lite client ( |
🧭 What and Why
🎟 JIRA Ticket:
Changes included:
closes algolia/algoliasearch-client-javascript#1544
use tsup instead of rollup, just because I wanted to try it out and it seems to exactly do what we need, a bit faster and easier to configure.
also add attw and publint, in order to debug the exported types, package.json#export field, and the resolved imports.
how to verify it works?
test:size
, should be all green without being too far from the thresholdtest:bundle
on many clients, they are all green5.2.4-beta.2
directly