Giter Site home page Giter Site logo

Comments (3)

Rich-Harris avatar Rich-Harris commented on September 27, 2024 1

Great question! The thinking here us that for most UI widgets, the biggest dependency by far is the framework it's built against, meaning you never see people using (for example) React-based widgets unless their app is already using React (and that's before we start worrying about version mismatches etc).

The Svelte no-runtime approach doesn't mean that Svelte components have to bundle all their dependencies – the built components would be like any other JavaScript module, with possibly overlapping third party dependencies like lodash.uniq. (In many cases those dependencies are small enough that it does make sense to offer a self-contained UMD bundle, but that's a separate issue.) Most people would presumably have a build process that deduped third party dependencies in Svelte components like any others, so if you had this...

import ThisComponent from 'this-component';
import ThatComponent from 'that-component';

...and this-component and that-component both used lodash.uniq, you would only end up with one copy of it in your app.

from svelte.

zcei avatar zcei commented on September 27, 2024

Ah so I overestimated the power a bit.. it's not inlining dependencies except the svelte parts itself?
Just wondering whether there is a clear border between transformations, inlining, and further dependencies.

Very interesting approach, I'll try to follow along 🙂

from svelte.

Rich-Harris avatar Rich-Harris commented on September 27, 2024

Yep, if you want to inline the dependencies then you'll still use a module bundler for that (ahem) – the key difference with Svelte is that it doesn't add another dependency, unlike every other UI framework!

from svelte.

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.