Giter VIP home page Giter VIP logo

Comments (6)

valeriy-maslov avatar valeriy-maslov commented on July 18, 2024

Guys, I am actually dont know what kind of task can it be where such module structure can be handy.
@AlexeyKashintsev , can you provide an example of such task? Cause I am completely confident that any task can be solved without recursive dependency.

from platypus-js.

AlexeyKashintsev avatar AlexeyKashintsev commented on July 18, 2024

Yes it's not quite common situation. But Platypus.JS have to handle such situation with normal work or by providing error message. Right now it just stops and do nothing.

from platypus-js.

valeriy-maslov avatar valeriy-maslov commented on July 18, 2024

Agree about error message in this kind of situations.
But still I am sure that using circular dependency is realy ugly practice in software design, so it must be avoided. Doesn't matter it is AMD or any other specification.
As an exception in some rare situations where this can't be avoided using some module in define() dependency array argument is not really neccessary while require() can be used any time. I think this can work fine. Try this, give us a note if this solution will work.

from platypus-js.

AlexeyKashintsev avatar AlexeyKashintsev commented on July 18, 2024

Can't disagree with @hcspidergrasp. Anyway it's not a question of architecture, it's only bug issue.
And I've found that there is a little holy war by the topic ;)
http://stackoverflow.com/questions/17146224/how-to-solve-circular-dependency-in-require-js
http://stackoverflow.com/questions/4881059/how-to-handle-circular-dependencies-with-requirejs-amd
...

from platypus-js.

marat-gainullin avatar marat-gainullin commented on July 18, 2024

The problem with error message regarding circular dependencies is detection of such references. AMD format is asynchronous and so it is hard to detect such references. If you have such reference there nothing to examine to produce an error message. The system simply stops and it is all.

A developer can detect if his project contains circular references with a tool. For example madge from the stackoverflow post mentioned earlier.

from platypus-js.

valeriy-maslov avatar valeriy-maslov commented on July 18, 2024

@AlexeyKashintsev, looks like this holy wars caused by closeness of deadline when there is no time for rethinking of software design %)))

from platypus-js.

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.