Comments (9)
Branch is created: https://github.com/danpaz/bodybuilder/tree/ts-migration
from bodybuilder.
@johnnyraphic Take a look at https://github.com/johannes-scharlach/elasticbuilder
2 years ago I did an almost complete re-write of bodybuilder in TS while copying most of the tests from this project. And since bodybuilder hasn't really changed since then this should still be up to date.
You can think of that project as a major update to bodybuilder with a breaking API change (and without any testing in production so far).
What's missing to merge it back into this project is backwards compatibility to the (very versatile) bodybuilder API. I believe that that's actually possible, so if you want to make bodybuilder work with TS, that's probably the easiest path.
from bodybuilder.
FWIW I'd be fully supportive of this, it's been a while since the TS type definitions were added and there for sure is room to improvement.
Is it possible to implement this in pieces instead of a complete rewrite? e.g. with allowJs: true
in tsconfig
from bodybuilder.
Back when I did that rewrite, I saw no good way to get started on a gradual approach. I don't recall all the details why and now when you compare my rewrite with bodybuilder, you see that the file structure is very similar.
It might be possible to compare the two repos and figure out some ways to do this gradually.
I have in the end completely changed the way data is represented internally in the builders without affecting the external API. There because the internal state within bodybuilder isn't covered with any JSDoc types.
from bodybuilder.
@danpaz To be honest you could do something like you suggested with allowing js to do a partial migration but tbh i don't see why you would like to do that since the code base isn't that big imo to go for that approach since it would be more of a hindrance than helpful imo.
Is there any reason I'm missing here with the partial migration to TS?
from bodybuilder.
from bodybuilder.
so I would recommend that we create a ts migration branch or something in the repo and than we can create multiple PRs just as you said and that would be more manageable to that branch and once that branch is ready we will merge it to the master branch and create a new release that supports es import properly
from bodybuilder.
👍 sounds good! Thanks for kicking this off
from bodybuilder.
Sure thing :)
I'll wait for you to create the branch and you can tag me or something and ill start working on that.
I would recommend that if you have any specification as to how you would like stuff to be typed or as to how stuff would look out, to write it out before people would start working on that to try and make this as efficient as possible.
from bodybuilder.
Related Issues (20)
- Script Based Sort HOT 1
- Can you please publish 2.2.22 to NPM? HOT 3
- Problem with 2.2.23 npm release? HOT 14
- Bodybuilder v3.0 HOT 8
- Escaping hyphens HOT 3
- Lodash & treeshaking. HOT 2
- Travis no longer builds on travis-ci.org HOT 1
- [Question] Is there a way to convert ES queries to bodybuilder implementation? HOT 3
- [Question] How to merge two bodybuilder queries? HOT 3
- How to convert the query to bodybuilder syntax? HOT 1
- Use npm automation token in CI
- Support for aggregations without field missing HOT 1
- Elasticsearch msearch? HOT 1
- Is it possible to control the order of methods when chaining multiple? HOT 2
- Release new version from master branch HOT 1
- Dependency lodash.set has Prototype Pollution vulnerability HOT 6
- [Question] How would you use Bodybuiler on aggs queries? HOT 2
- How to generate the following nested statements HOT 1
- Embed types into the source code
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 bodybuilder.