Giter VIP home page Giter VIP logo

Comments (3)

Rich-Harris avatar Rich-Harris commented on May 28, 2024

Whoops. My understanding of [].sort was way off the mark, thanks for the explanation. The intent was just to make sure that...

var a = 1;
export default a;
a = 2;

...would maintain the same order, since (due to the fact that export default a isn't a live binding like export {a}) it effectively needs to be rewritten as this:

var a = 1;
var _a = a;
a = 2;

It's a bit of a nuisance edge case (and rare, as far as I can see) but specs are specs. Ordinarily statements preserve the correct order naturally, but export default trips things up.

I apologize if this is a distraction.

Far from it - being able to catch these things at this stage of the library's development is absolutely invaluable. I apologize for breaking your builds! Am working on a solution for this issue.

from rollup.

Rich-Harris avatar Rich-Harris commented on May 28, 2024

Okay, I've come up with what seems like a more appropriate solution - we have some special logic for dealing with cases like the above. Rather than attempting to reorder statements at a bundle level, the expansion of export default a is modified in place (if necessary) such that the export declaration appears before any later statements from the same module. The d3-color tests now pass, so I've released this as 0.7.4 - feel free to reopen this issue if it turns out the bug isn't quite squashed.

from rollup.

mbostock avatar mbostock commented on May 28, 2024

Thanks. Looks good!

from rollup.

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.