Giter VIP home page Giter VIP logo

Comments (1)

mage-eag avatar mage-eag commented on July 19, 2024

Though I agree with you, in fact I did not get much feedbacks concerning this since the launch of the extension (actually, it must nearly be the second or third one).

Anyway, the reason why the code uses eval is that one of the main requirement for the extension, when I started developing it 2 years ago, was to keep it as much compatible as possible with the rest, while being completely transparent for the core and 3rd party extensions, and adding lots of features to the grids.
To achieve this, one of the solutions - if not the only - was to create, for each grid that it rewrites, a dynamic class inheriting from the corresponding class, and that should be used instead. This way, eg, all instanceof and related calls are ensured to be kept working.
At the time, the only way I found to do so was to use eval, knowing that yet today I'm not sure there are another solutions, and this, even if eval has its drawbacks - at least, security ones do not concern us -.
Reflection could be considered, as it brings almost everything that's needed, but yet it lacks the dynamic inheritance and class name, that I'm not sure that we could easily get rid of.

However, if you have some ideas on how it could be used, I'm completely opened concerning a possible refactoring of this part :)

from mage-enhanced-admin-grids.

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.