Comments (3)
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.
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.
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)
- false positive a11y warning for buttons and links without text but with image alt attribute HOT 3
- Runes: cannot optionally `bind:` to a component's prop if not exported HOT 1
- Svelte 5 unused $state memory leak HOT 5
- Svelte does not support import maps HOT 3
- Strange type error when using ComponentProps HOT 2
- Svelte stripping classes HOT 11
- Returning a promise on `get` from a user-defined proxy that's put in context throws an error on `getContext` HOT 1
- src attribute of script in svelte:head is undefined unless any other element is present HOT 2
- Unlike Svelte 4, the current rc version of Svelte 5 executes children actions after parent actions HOT 2
- Nesting selectors inside `:global` selectors are disregarded HOT 3
- REPL: Add ability to add files of different formats HOT 2
- Nested atrule in unused selector results in broken CSS output
- [Svelte 5] Optinal snippets in pair tags does not work with {#if}{/if} HOT 6
- svelte 5: anonymous function declaration broken
- `:has(...)` contents are not scoped HOT 1
- Add bind:scrollWidth & bind:scrollHeight properties HOT 1
- Keyed each block indexes out of order HOT 1
- Unused CSS selector "*" when only using root pseudo class selector to set CSS variables HOT 3
- Svelte 5 $effect rune and untrack HOT 2
- Feat: Add an option to not pass a snippet in props HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svelte.