Comments (9)
Koa supports generator function as a async await replacement.
from s3rver.
Promise.coroutine
is essentially the main export of co
which comes with Koa. I think we should be able to get by without involving Bluebird.
from s3rver.
Hey there!
First of all I love koa and async/await.
I also noticed that the code base is quite messy and not optimal.
We also should support all LTS node versions.
if we would do this could use koa 2 with generator functions (http://node.green/#ES2015-functions-generators). Once LTS for 6 is dropped we could easily change those to async functions.
I think a babel build step would be a bit of an overkill
What do you think @leontastic? I would definitely love to see this, however I do not have all the time to convert/rewrite the application.
from s3rver.
I'd be down to do most of it, I haven't been too strapped for time.
Node 4 supports most of the important ES2015 features (nvm spread and rest params are pretty useful, and its EOL is in April) including generators so I think it would be reasonable to target v6 and use either Koa 1 or Koa 2 with the deprecation warnings disabled.
from s3rver.
Code is very messy. I want to refactor it myself but I also haven't found the bandwidth to do so.
Not opposed to using Koa or Babel at all. I think introducing a build step is a worthy trade-off to allow us to take advantage of next-gen syntax features. As long as we keep the build config simple, so it doesn't introduce maintenance headaches down the road.
from s3rver.
Even if we go the Babel route, I recently realized that it isn't entirely feasible since a large portion of the Koa 2 ecosystem expects Node.js 7.6+, which means that we'd have to choose what dependencies we use carefully. We'd need to depend on versions written for Koa 1.x and we'd only be able to update once Node 6 exits LTS.
I think it's reasonable just to write for Koa 1 for now bearing in mind that it will need to be adapted for Koa 2 later. If you do it right it's pretty painless, I've done it for a much larger project than this when it got bumped up to Node 8.
from s3rver.
What parts of koa 2 couldn't we use? Also I think babel would be overkill.
from s3rver.
I just checked and it looks like most of the important ones are safe (koa
, koa-compose
, and koa-router
) so we'd probably actually be fine. I also kind of agree that Babel is overkill since the only feature we actually need is async/await.
from s3rver.
Could just use Promise.coroutine
from Bluebird to get async/await
-like syntax without needing a babel transform. I'd love to introduce Bluebird anyway to convert async logic to promises.
from s3rver.
Related Issues (20)
- Project inactive? HOT 10
- replace moment.js with maintaned date library HOT 2
- vhostBuckets Documentation Confusing HOT 2
- Close Stale Issues/PRs HOT 5
- Error = A parameter you provided functionality that in not implemented HOT 6
- Error: fopen(httpseek://): failed to open stream ... HOT 4
- Storage Class not being respected HOT 5
- Question: Is s3rver a s3 "private" / "public" or both? HOT 1
- key should be Key, capitalized, following the AWS SDK documentation HOT 4
- Content Range header not returned when requested range is 'bytes=0-' HOT 1
- Dependency Dashboard
- Failed to upload large file (53Mb)
- Apparent race condition deleting objects results in ENOENT HOT 1
- Custom Store
- attention on files contains url ecoding putcopy function need decodeURIComponent
- Security Issue in Dependency - CVE-2022-24434 HOT 4
- Feature request - storing/retrieving checksum metadata (x-amz-checksum) inside object attributes
- Simulate slow fetch
- fast-xml-parser vulnerable to prototype pollution SNYK-JS-FASTXMLPARSER-3325616 sonatype-2023-0998
- if i use aws java v2 sdk putobject fail HOT 2
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 s3rver.