-
Notifications
You must be signed in to change notification settings - Fork 50
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
Automated backward-compatible code with Babel #38
base: master
Are you sure you want to change the base?
Conversation
fa0873c
to
096af91
Compare
Babel is too much for this task. Modern way to me is |
@apla You proposed good stack of tools, but lets highlight possible problems that we've trying to solve: Enviroment based polyfils.
As i understand, Buble does not provides any polyfills support, just transforms. Automatic feature detectionA lot of ES6+ are supported by nodejs for now, e.g. Object/arguments spread & rest and doesn't require transformations. Buble just transforms all known features by preconfigured list of transforms Syntax featuresA lot of code in this repo can be simplified with Buble has interesting philosophy and good set of transform, but i dont thins that its enough. Module bundlingThis is the rich nodejs library, which does not requires bundling. All imports working pretty good, even duplicated imports are handled by nodejs itself ES modules (Tree shaking?)This is the project with simple file structure, and es-modules doesn't gave any benefits (except beautiful syntax). MaintenanceBabel are stable project, with large community. It easy to setup and maintain (look at the config in this PR - its complete setup with Babel) |
096af91
to
6482959
Compare
Codecov Report
@@ Coverage Diff @@
## master #38 +/- ##
=========================================
+ Coverage 87.81% 94.21% +6.4%
=========================================
Files 5 4 -1
Lines 320 294 -26
=========================================
- Hits 281 277 -4
+ Misses 39 17 -22
Continue to review full report at Codecov.
|
I've checked current setup with dummy ▶ npm publish
> @apla/[email protected] prepublishOnly .
> npm run build
> @apla/[email protected] build /Users/nezed/projects/node-clickhouse
> rm -r lib*/; babel src -d lib --source-maps && BABEL_ENV=legacy babel src -d lib-legacy --source-maps
Successfully compiled 4 files with Babel.
Successfully compiled 4 files with Babel.
npm notice
npm notice 📦 @apla/[email protected]
npm notice === Tarball Contents ===
npm notice 1.6kB package.json
npm notice 442B index.js
npm notice 1.1kB LICENSE
npm notice 8.2kB README.md
npm notice 10.5kB lib-legacy/clickhouse.js
npm notice 21.9kB lib-legacy/clickhouse.js.map
npm notice 1.5kB lib-legacy/parse-error.js
npm notice 2.6kB lib-legacy/parse-error.js.map
npm notice 5.6kB lib-legacy/process-db-value.js
npm notice 8.0kB lib-legacy/process-db-value.js.map
npm notice 4.9kB lib-legacy/streams.js
npm notice 10.4kB lib-legacy/streams.js.map
npm notice 9.9kB lib/clickhouse.js
npm notice 21.9kB lib/clickhouse.js.map
npm notice 1.1kB lib/parse-error.js
npm notice 2.6kB lib/parse-error.js.map
npm notice 4.6kB lib/process-db-value.js
npm notice 8.0kB lib/process-db-value.js.map
npm notice 4.8kB lib/streams.js
npm notice 10.4kB lib/streams.js.map
npm notice === Tarball Details ===
npm notice name: @apla/clickhouse
npm notice version: 1.6.0
npm notice package size: 38.7 kB
npm notice unpacked size: 139.9 kB
npm notice shasum: f5c2cc81a2c3632ccad21cb3a17b8404cd6fb90f
npm notice integrity: sha512-j6ffxHd4k4Nkm[...]smrZBb+n5Coug==
npm notice total files: 20
npm notice
npm ERR! code E404
npm ERR! 404 Not Found - PUT https://registry.npmjs.org/@apla%2fclickhouse - Not found
npm ERR! 404
npm ERR! 404 '@apla/[email protected]' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!) |
A lot of ES6+ syntax features like
const
,async/await
, spread operator and etc are supported in [email protected]+.Node.js release calendar says that maintenance of node@6 LTS was ended at may of 2019.
This means that all versions earlier node@8 become obsolete.
I'm proposing to do different code builds for legacy and actual nodejs version