Code Monkey home page Code Monkey logo

Comments (5)

allforabit avatar allforabit commented on May 29, 2024 1

Ah great! That would make it very straightforward. I haven't done any webpack loader development but I can make a go at implementing it.

from components.js.

RubenVerborgh avatar RubenVerborgh commented on May 29, 2024 1

That would be awesome, please keep us updated!

from components.js.

RubenVerborgh avatar RubenVerborgh commented on May 29, 2024

For the browser, you typically want to optimize for size, so it makes sense to resolve the dependencies at compile time, which also gives a performance benefit because it does not need to be performed at runtime.

Additionally, webpack etc. have to know which dependencies to ship to the browser; they can't be resolved at runtime like Node.js does.

So doing this is definitely the recommended way; and for me the only why how I can imagine it working in the browser. Unless @rubensworks sees other ways.

from components.js.

allforabit avatar allforabit commented on May 29, 2024

Thanks for the speedy reply. For production it would definitely need to be compiled. I'm really just wondering about ergonomics during development. I wonder would it make sense if there was a custom webpack loader? The webpack documentation on writing a custom module loader mention give special mention to loaders that use the file system, saying they should integrate with webpack's module system. https://webpack.js.org/contribute/writing-a-loader/#module-dependencies So maybe it would be a matter of translating the componentsjs module loading into webpack loading. Easier said than done of course :-)

from components.js.

RubenVerborgh avatar RubenVerborgh commented on May 29, 2024

Ah yes, the script that interprets a Components.js configuration into JavaScript code could definitely be a webpack loader; it would not need to be that hard. Under the hood, it can remain the same; it should just return the JavaScript to webpack rather than outputting it.

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