26 Matching Annotations
- Nov 2021
- Mar 2021
-
www.jackfranklin.co.uk www.jackfranklin.co.uk
-
but I like that Svelte comes with a good CSS story out the box.
comes with a good CSS story out the box
-
Svelte is different in that by default most of your code is only going to run once; a console.log('foo') line in a component will only run when that component is first rendered.
Tags
- Svelte: styles
- reasonable defaults
- opinionated
- library/framework should provide this (standard solution) rather than everyone having to write their own slightly different solution (even if it is easy enough to write yourself)
- opinion
- turning things around / doing it differently
- important point
- Svelte
- trying to doing things the same way you did in a different library/framework (learning new way of thinking about something / overcoming habits/patterns/paradigms you are accustomed to)
- difference
- Svelte vs. React
- annotation meta: may need new tag
- out of the box
- unfortunate defaults
Annotators
URL
-
- Jan 2021
-
-
If components gain the slot attribute, then it would be possible to implement the proposed behavior of <svelte:fragment /> by creating a component that has a default slot with out any wrappers. However, I think it's still a good idea to add <svelte:fragment /> so everyone who encounters this common use case doesn't have to come up with their own slightly different solutions.
-
-
github.com github.com
-
Popper for Svelte with actions, no wrapper components or component bindings required! Other Popper libraries for Svelte (including the official @popperjs/svelte library) use a wrapper component that takes the required DOM elements as props. Not only does this require multiple bind:this, you also have to pollute your script tag with multiple DOM references. We can do better with Svelte actions!
-
- Nov 2020
-
stackoverflow.com stackoverflow.com
- Oct 2020
-
lemoncode.github.io lemoncode.github.ioFonk1
-
Fonk is framework extension, and can be easily plugged into many libraries / frameworks, in this documentation you will find integrations with:
-
-
github.com github.com
-
github.com github.com
-
dylanvann.com dylanvann.com
-
To fix our Svelte version you might think we could use beforeUpdate or afterUpdate, but these lifecycle functions are related to the DOM being updated, not to prop updates. We only want to rerun our fetching when the album prop is changed.
-
-
medium.com medium.com
-
Sometimes, you may be tempted to write that wrapper. Because all your (React or Vue or insert your reactive framework here) instincts tell you so.Resist the temptation. There is a better way. A svelter way. Introducing: the use-directive (a.k.a. “actions”).
-
However, especially when starting out, it’s very easy to fall into the “this is how I did things in my previous framework” trap.
Tags
- getting a fresh perspective
- overcoming preconceived opinions
- paradigm shift
- Svelte: action (use:)
- different way of thinking about something
- Svelte
- trying to doing things the same way you did in a different library/framework (learning new way of thinking about something / overcoming habits/patterns/paradigms you are accustomed to)
Annotators
URL
-
-
github.com github.com
-
this is a common Svelte idiom for manually invalidating something that might have been mutated without there being a visible = sign somewhere
-
- Sep 2020
-
github.com github.com
-
I don't understand why it just launches the mutation once and then it throws the error Function called outside component initialization, the only way to make it work is to do something like $: result = mutation(...) but it doesn't make sense, I don't want to run the mutation after each keystroke.
-
-
github.com github.com
-
urql/packages/svelte-urql/ Go to file Add file Go to file Create new file Upload files urql/packages/svelte-urql/
-
-
github.com github.com
-
Svelte will not offer a generic way to support style customizing via contextual class overrides (as we'd do it in plain HTML). Instead we'll invent something new that is entirely different. If a child component is provided and does not anticipate some contextual usage scenario (style wise) you'd need to copy it or hack around that via :global hacks.
-
The RFC is more appropriate because it does not allow a parent to abritrarily control anything below it, that responsibility still relies on the component itself. Just because people have been passing classes round and overriding child styles for years doesn't mean it is a good choice and isn't something we wnat to encourage.
Tags
- forking to add a desired missing feature/change
- limiting how much library consumers/users can control/override
- maintenance burden to explicitly define/enumerate/hard-code possible options (explicit interface)
- whose responsibility is it?
- Svelte: how to affect child component styles
- component/library author can't consider/know ahead of time all of the ways users may want to use it
- programming: who is responsible for this concern?
- workarounds
- control (programming)
- Svelte: components are their own boss (encapsulation)
- ugly/kludgey
- forced to fork/copy and paste library code because it didn't provide enough customizability/extensibility / didn't foresee some specific prop/behavior that needed to be overridable/configurable (explicit interface)
- trying to prevent one bad thing leading to people doing/choosing an even worse option
- which component/tool/organization/etc. is responsible for this concern?
- run-time dynamicness/generics vs. having to explicitly list/hard-code all options ahead of time
Annotators
URL
-
-
github.com github.com
-
The point of the feature is to not rely on the third-party author of the child component to add a prop for every action under the sun. Rather, they could just mark a recipient for actions on the component (assuming there is a viable target element), and then consumers of the library could extend the component using whatever actions they desire.
Tags
- Svelte: action (use:)
- pass-through arguments/props/options
- flexibility
- component/library author can't consider/know ahead of time all of the ways users may want to use it
- run-time dynamicness/generics vs. having to explicitly list/hard-code all options ahead of time
- extensibility
Annotators
URL
-
-
github.com github.com
-
The more I think about this, the more I think that maybe React already has the right solution to this particular issue, and we're tying ourselves in knots trying to avoid unnecessary re-rendering. Basically, this JSX... <Foo {...a} b={1} {...c} d={2}/> ...translates to this JS: React.createElement(Foo, _extends({}, a, { b: 1 }, c, { d: 2 })); If we did the same thing (i.e. bail out of the optimisation allowed by knowing the attribute names ahead of time), our lives would get a lot simpler, and the performance characteristics would be pretty similar in all but somewhat contrived scenarios, I think. (It'll still be faster than React, anyway!)
-
-
github.com github.com
-
c0bra.github.io c0bra.github.ioSvelma1
-
github.com github.com
-
illright.github.io illright.github.io