Coder Social home page Coder Social logo

Comments (13)

nolanlawson avatar nolanlawson commented on July 24, 2024

Example input and output: https://gist.github.com/vigneshshanmugam/89867ac713d1160c865c53c93e47470a

from optimize-js.

ggoodman avatar ggoodman commented on July 24, 2024

For science: https://gist.github.com/ggoodman/72c4366ebe9bee47ad158527ee4c5e93

from optimize-js.

TheLarkInn avatar TheLarkInn commented on July 24, 2024

Did we test these w/ the V8LazyParseWebpackPlugin?

from optimize-js.

ggoodman avatar ggoodman commented on July 24, 2024

@TheLarkInn if I had some guidance on moving to Webpack 2, I would try it out.

from optimize-js.

TheLarkInn avatar TheLarkInn commented on July 24, 2024

That plugin may work with webpack 1 also, but what specifically do you need help with for webpack 2.

from optimize-js.

nolanlawson avatar nolanlawson commented on July 24, 2024

This may be a good first patch, given that you basically just need to add a new test case (input.js and output.js) and then add a new condition to check if the function is inside an array inside of a call expression. ASTExplorer is very helpful here.

from optimize-js.

vigneshshanmugam avatar vigneshshanmugam commented on July 24, 2024

@TheLarkInn Does lazyparseplugin adds the parans for the modules in array?

from optimize-js.

TheLarkInn avatar TheLarkInn commented on July 24, 2024

It sure does!! If you have a large app feel free to try it. Only catch is that I believe you have to tell UglifyJsPlugin compress option to set negate_iife: false.

from optimize-js.

TheLarkInn avatar TheLarkInn commented on July 24, 2024

@vigneshshanmugam if you have an app that we can test with I'd be interested to see the statistics.

from optimize-js.

vigneshshanmugam avatar vigneshshanmugam commented on July 24, 2024

@TheLarkInn I tried it and updated the gist. It fails to wrap the inner functions as well.

Also updated the readme here - TheLarkInn/LazyParseWebpackPlugin#4

from optimize-js.

TheLarkInn avatar TheLarkInn commented on July 24, 2024

Awesome!!! I intentionally didn't wrap the inner functions inside modules because I wasn't sure the benefit, but it's definitely possible to use a webpack parser plugin to do this.

from optimize-js.

vigneshshanmugam avatar vigneshshanmugam commented on July 24, 2024

Ahh got it.. But i believe the benchmarks in the README includes the wrapping for inner functions as well.. Anyways as you said, its possible to do this :)

from optimize-js.

nolanlawson avatar nolanlawson commented on July 24, 2024

Fixed in #33

from optimize-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.