Coder Social home page Coder Social logo

Comments (20)

crunchtime-ali avatar crunchtime-ali commented on May 1, 2024 1

@Aurelsicoko I didn't know about the leaks. Will definitely test this some more and follow the thread you mentioned.

from strapi.

Aurelsicoko avatar Aurelsicoko commented on May 1, 2024 1

Except for Lusca, the others middlewares have been updated and we can almost say that Strapi has successfully made the transition to Koa 2. I'm closing this issue because it's not relevant anymore. Thanks to everyone involved in it!

from strapi.

crunchtime-ali avatar crunchtime-ali commented on May 1, 2024

Updated koa-send and koa-compose as they now contain a v2 compatible branch.
Removed koa-load-middleware from the list as it needs no updating to be compatible with koa v2.

from strapi.

fundon avatar fundon commented on May 1, 2024

Released koa-i18n@v2.

from strapi.

loicsaintroch avatar loicsaintroch commented on May 1, 2024

Awesome! Thanks for the update @fundon we appreciate.

from strapi.

crunchtime-ali avatar crunchtime-ali commented on May 1, 2024

I've exchanged koa-gzip with koa-compress here too (see #87) because we won't switch to koa v2 before Strapi 2.0 is released.

I also propose adding a Future milestone and adding this Issue to it.
The reason is there is currently no estimate on when async/await will land in V8 and even worse in Node itself. Therefore this would delay Strapi 2.0 greatly.

from strapi.

loicsaintroch avatar loicsaintroch commented on May 1, 2024

@dj-hedgehog I agree with you. However I prefer to change the milestone when we'll work with our new OSS workflow. I'll write some blog posts about the v2, our vision and our goals to be completely honest and transparent with the community.

from strapi.

crunchtime-ali avatar crunchtime-ali commented on May 1, 2024

The situation keeps getting brighter koa-response-time, koa-static, koa-compress & koa-views all have respective branches for v2.x. I'll take care of some of the missing ones myself when I find the time.

from strapi.

Aurelsicoko avatar Aurelsicoko commented on May 1, 2024

I suggest moving from koa-ssl to koa-sslify. koa-sslify looks more maintained and popular. The middleware offers more options such as Azure support and reverse proxies. We can't stay on an unused middleware without any update since 2 years.

from strapi.

crunchtime-ali avatar crunchtime-ali commented on May 1, 2024

Now, things are getting interesting as there is native async..await support in the just released Node v7.
I suggest moving to Koa v2 now because that makes working with Strapi even easier. Also v3 isn't released yet.

from strapi.

Aurelsicoko avatar Aurelsicoko commented on May 1, 2024

@dj-hedgehog async/await seems buggy on V8 5.4 and have some nasty memory leaks... I will create a branch koa@next and start moving to Koa v2. Furthermore, it requires --harmony-async-await flag to start. The harmony flag is not recommended for production use. However, the strapi-v3@alpha will not be ready for production use so it is not a real problem for now.

FYI, I'm following this thread on Koa's repository to get in touch.

from strapi.

Aurelsicoko avatar Aurelsicoko commented on May 1, 2024

I started my work on the branch improvement/koa2. It works pretty well. It seems faster to load. Furthermore, we don't need generator functions into our controllers anymore.

I used koa-convert to convert the middleware which are not ready to work with Koa2.

from strapi.

StevenACoffman avatar StevenACoffman commented on May 1, 2024

by the way koa-cors next branch

from strapi.

Aurelsicoko avatar Aurelsicoko commented on May 1, 2024

@StevenACoffman Thanks for the link! I was wondering if we should move to the official CORS's middleware for Koa (https://github.com/koajs/cors). It provides the exactly same features and this middleware is highly maintained by the Koa core team.

from strapi.

StevenACoffman avatar StevenACoffman commented on May 1, 2024

@Aurelsicoko Yeah, unless there is some sign of recent activity, I think you're probably right to switch to the official package. I hadn't realized the official project existed.

from strapi.

Aurelsicoko avatar Aurelsicoko commented on May 1, 2024

@StevenACoffman Me too... I moved to the official package today on the branch improvement/koa2 and it works fine!

from strapi.

Aurelsicoko avatar Aurelsicoko commented on May 1, 2024

FYI, we are using koa-generic-session instead of koa-session. Also, we are no longer using koa-graphql by default. As I previously said, the GraphQL support will be available through a plugin.

Summary of changes we made:

@dj-hedgehog I'll let you update the middlewares' list. Thanks for your time!

from strapi.

crunchtime-ali avatar crunchtime-ali commented on May 1, 2024

@Aurelsicoko I updated the list.
Since you have been using Koa v2 already with Strapi. What are your experiences so far? When do you plan to switch?

from strapi.

Aurelsicoko avatar Aurelsicoko commented on May 1, 2024

@dj-hedgehog Thank you so much! I can tell you that's Koa v2 could be a game changer in the next months. I'm very excited about the next release of Node without the harmony flag for async/await.

Here a summary of my feedback:

  • Reducing the codebase (from 20% to 50% in some cases) thanks to async/await.
  • The codebase is more readable and understandable.
  • Better error handling. (Btw in v3, we created a errors middleware based on top of Boom which automatically formats the errors and considerably reduces the number of try/catch patterns in your codebase)
  • I haven't notice performances improvements for now.

We should switch as soon as Node will allow using async/await without harmony flag. We are already working on big projects with [email protected]. It's so nice and most natural to develop an application like that.

from strapi.

FabioSilvaBRZ avatar FabioSilvaBRZ commented on May 1, 2024

Hi, guys.
I have been trying to install Strapi V3 but I still have message erros like:
...
npm ERR! git rev-list -n1 v2.x: fatal: ambiguous argument 'v2.x': unknown revision or path not in the working tree.
npm ERR! git rev-list -n1 v2.x: Use '--' to separate paths from revisions, like this:
npm ERR! git rev-list -n1 v2.x: 'git [...] -- [...]'
...

I checked the packages been installed and the following situation came up: in the error message it was trying to install like 29 packages - and I tried to install manually all of them to test if they work properly.
In a list of 25 packages there were a couple with the .x version.
npm install "koa-bodyparser@koajs/bodyparser#3.x"
npm install "koa-send@koajs/send#2.x"
They were installed just fine...

But there were 4 packages that do not install:
npm install "koa-compress@koajs/compress#v2.x"
npm install "koa-favicon@koajs/favicon#v2.x"
npm install "koa-response-time@koajs/response-time#v2.x"
npm install "koa-mount@koajs/mount#next"
They return the error reported above

Checking the GITHUB for these versions, one .x version that works I can find it at Github. For example: "koa-bodyparser@koajs/bodyparser#3.x"
image

But the "koa-compress@koajs/compress#v2.x" is not there, as follows:
image

Is it wrong? Long story short, those packages probably do not exist at all...

Another example?
"koa-response-time@koajs/response-time#v2.x"
image

from strapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.