Coder Social home page Coder Social logo

Comments (5)

jrburke avatar jrburke commented on June 8, 2024

This might make sense. I normally like just distributing one file, just because it keeps it simple. But I'm open to it. @pmuellr, would this be useful for you? @gtanner any thoughts? This might have saved you some trouble.

from almond.

alexlawrence avatar alexlawrence commented on June 8, 2024

Hi again,

we don´t have this issue anymore since yesterday. Since we are also using require.js and had to do some configuration for it we ran into the same issue. So we figured how to ensure the following order: amd tool -> amd tool configuration -> amd modules.

Stay with the one file if nobody else needs it.

Great tools btw!

from almond.

pmuellr avatar pmuellr commented on June 8, 2024

I've never understood why order was significant, unless there were side-effects in your "modules" - eg, code running outside the define() invocation - which required you to get things lined up in a particular order. But it's wrong to do that, so this should never be a problem.

So, I'd be in favor of removing all the code you have that assumes an order, and handles overrides for when you want "unordered", etc. Perhaps we can use these recovered bytes to implement issue #8? :-)

from almond.

gtanner avatar gtanner commented on June 8, 2024

I found working with almond in the "ordered" fashion to be awkward. I would expect that my modules are lazy loaded and the construction code isn't executed until the first require (which is the behavour unordered gives us).

I am with @pmuellr in that I seem to be missing the point of why order is significant. I also agree with @pmuellr that I would rather trade the added behavour in #8 with taking out the ordered define support

from almond.

jrburke avatar jrburke commented on June 8, 2024

The ordered behavior was to mimic traditional script loading in the browsers, and for the canonical example of requirejs use, there is a data-main="" on the script tag that is the original require(), so it is possible to construct apps with that approach that only use define(), never a top-level require. Since r.js orders the modules, unordered was not originally needed, and the code is a bit smaller if unordered is removed vs removing ordered.

To just go the unordered path, there would need to be a way for the data-main type of apps to tack on a require for that value, or something to trigger the modules to execute. I cringe at using a setTimeout() too. So the code to add to allow those triggers would likely cancel out any savings from removing the ordered path.

In any case, for this issue, I'll close it for now. I'm still reviewing/considering the feedback on #8 separately.

from almond.

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.