Code Monkey home page Code Monkey logo

Comments (6)

manuelpeiso avatar manuelpeiso commented on June 21, 2024

#544

from cakephp-swagger-bake.

cnizzardini avatar cnizzardini commented on June 21, 2024

I believe the reason is, even if with hotReload set to off, a user may still run this code via the CLI. In fact, running via the CLI (e.g. bin/cake swagger bake) is the recommended way to deploy to production.

I see your PR has a condition for SAPI CLI, but I am highly worried about introducing this change. Why? I don't know, other than I have a hunch this will cause problems for other users.

from cakephp-swagger-bake.

cnizzardini avatar cnizzardini commented on June 21, 2024

This is a valid issue and I will explore it more. However, I find it unlikely I will accept the PR for the reasons previously stated. For your specific case (I recall from slack you have something like 160+ routes), I would advise simply replacing SwaggerController with your own. The logic in there is very light:

https://github.com/cnizzardini/cakephp-swagger-bake/blob/2.x/src/Controller/SwaggerController.php

You may extract out the logic from the injected service (https://github.com/cnizzardini/cakephp-swagger-bake/blob/2.x/src/Lib/Service/OpenApiControllerService.php) and place it directly in your controller or define your own service and it inject it per: https://book.cakephp.org/4/en/development/dependency-injection.html

Is this a reasonable workaround to the performance issues your application is experiencing?

If you are keen on getting that PR passed, I will post a potential solution I might be okay with accepting in the PR.

from cakephp-swagger-bake.

cnizzardini avatar cnizzardini commented on June 21, 2024

I'm also curious if you identified the actual source of the performance issue. Knowing the specific cause, that is, the actual line or lines of code causing the performance issues is necessary for a resolution.

from cakephp-swagger-bake.

cnizzardini avatar cnizzardini commented on June 21, 2024

Also have you tried this: #454

from cakephp-swagger-bake.

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.