- Jan 2021
-
stackoverflow.com stackoverflow.com
-
For example, we might request some data from a stock exchange API, and along with our usual API parameters, we give it a callback, like ?callback=callThisWhenReady. The web service then wraps the data with our function and returns it like this: callThisWhenReady({...data...}). Now as soon as the script loads, your browser will try to execute it (as normal), which in turns calls our arbitrary function and feeds us the data we wanted.
-
-
discourse.ubuntu.com discourse.ubuntu.com
-
It’s all very well telling Canonical what to do, but someone needs to pay those developers for their time. It’s not free.
-
Repeatedly posting in this thread that there are problems, won’t actually get anything fixed.
-
The best place to let the developers know, and track those bugs is in the bug tracker. There are hundreds of forums online, all over the place in many languages. We can’t be expected to read all of them. Anyone with a launchpad ID (thus, anyone who has an account on this discourse instance) has the capability to file a bug. I’d strongly recommend doing so, for each specific issue. Taking just a few minutes to do that will help tremendously.
-
Just saying “snaps are slow” is not helpful to anyone. Because frankly, they’re not. Some might be, but others aren’t. Using blanket statements which are wildly inaccurate will not help your argument. Bring data to the discussion, not hearsay or hyperbole.
-
Progress is made of compromises, this implies that we have to consider not only disadvantages, but also the advantages. Advantages do very clearly outweigh disadvantages. This doesn’t mean it perfect, or that work shouldn’t continue to minimize and reduce the disadvantages, but just considering disadvantages is not the correct way.
-
Only folks who help package Chromium get to decide how Chromium gets packaged. This gives anyone two options: You can get involved and help package Chromium so you have a voice in the decision-making, or not.
-
Get back to Chromium : how its evolution will be handled by Debian ? How its cousin-sister-child projects will be handled ( vivaldi, brave, electron… ) ?
Tags
- unhelpful
- +0.9
- trade-offs
- don't just complain; help improve/fix things
- do pros outweigh/cover cons?
- compromise
- progress requires compromises
- dichotomous thinking
- good question
- having a voice in decision-making
- hasty generalization
- discussion without action
- helpful
- focus on ways/what you can improve
- good point
- progress
- improving one's process
- the needs of the many outweigh the needs of the few
- Snap
- software performance
- constant evolution/improvement of software/practices/solutions
- "me too"
- bug reports
- discussion
- not adding to discussion
- faulty generalization
- be specific
- get involved
Annotators
URL
-
-
www.alfiekohn.org www.alfiekohn.org
-
They may skim books for what they’ll “need to know.” They’re less likely to wonder, say, “How can we be sure that’s true?” than to ask “Is this going to be on the test?”
This is completely true! As a student we honestly do not care about anything, as long as our grade is an A. I hate that it is true, because sometimes as a student, I just want to really learn for a second. Although it is nearly impossible when pressured is applied based on a letter grade that may or may not affect one's life. This class is really helping realize that it is not me, is that pressure kills the beauty of learning.
-
-
-
Explained: Reason for the “The following packages have been kept back” error and how it was fixed The above suggested fix should solve the problem for you. But are you curious what caused the error and how was it fixed? Let me explain that to you. Normally, when you run the sudo apt update and sudo apt upgrade commands, it updates all the installed packages to their available newer versions. However, if the dependencies of an installed package have been changed such that it requires installation of new packages, the installed package won’t be upgraded with the system update and you’ll see package kept back error.
-
-
askubuntu.com askubuntu.com
-
but you're probably better off learning a bit more about APT and resolving the dependency issues "by hand" by installing and removing packages on a case-by-case basis. Think of it like fixing a car... if you have time and are handy with a wrench, you'll get some peace of mind by reading up and doing the repair yourself. If you're feeling lucky, you can drop your car off with your cousin dist-upgrade and hope she knows her stuff.
-
-
material.io material.io
-
Small components can set the size of their corner shape using a percentage of the absolute height of the component. This means the corner shape will change as the component height changes.
-
-
material.io material.ioButtons2
-
Dialogs use text buttons because the absence of a container helps unify the action with the dialog text. Align text buttons to the right edge for left-to-right scripts.
-
Text buttons are often embedded in contained components like cards and dialogs, in order to relate themselves to the component in which they appear. Because text buttons don’t have a container, they don’t distract from nearby content.
-
-
css-tricks.com css-tricks.com
-
The trouble with leaving the verb off is that if a user experiencing low or no vision is browsing with the aid of a screen reader, they may not be able to determine what the noun is for. Screen readers can scrape the current page and create lists by content type (headings, links, buttons, etc.) for easer navigation. Static text that is placed in visual proximity to the download links will not come along for the ride if accessed via this method. While it might seem redundant to show the word “download” over and over again, including it can go a long way to providing context for users navigating without visual aids, or who have zoomed the page’s content to the point where the layout may not communicate the visual relationship.
-
What if your download UI element isn’t just for a single static asset, but is actually generating a custom file when you press it? For example, if you have a list of files, you can check as many as you want, and pressing a download UI element zips those files together and then downloads that one file. In this case, we’d be using JS anyway, and the UI element is triggering more than just the link, it is ‘performing actions’, so a button would make sense, right?
-
One lesser-appreciated user-behaviour is when a user would like to choose an alternative download location. On a download link, your user can right-click -> “save link as…” and place the download directly into a folder of their choice. Handy if you want something to go directly to removable media, for example. On a download button, there’s no such option.
-
We can lay blame for this semantic drift squarely at the feet of trend. Designers and developers eager to try the latest and greatest invite ambiguity in with outstretched arms. Leadership chases perceived value to stay relevant.
-
Some may feel that the presence of the download attribute is redundant when applied to links the browser already knows to store. I disagree.
-
However, the W3C provides us with an important clue as to who is right: the download attribute.
-
The debate about whether a button or link should be used to download a file is a bit silly, as the whole purpose of a link has always been to download content. HTML is a file, and like all other files, it needs to be retrieved from a server and downloaded before it can be presented to a user. The difference between a Photoshop file, HTML, and other understood media files, is that a browser automatically displays the latter two. If one were to link to a Photoshop .psd file, the browser would initiate a document change to render the file, likely be all like, “lol wut?” and then just initiate the OS download prompt. The confusion seems to come from developers getting super literal with the “links go places, buttons perform actions.” Yes, that is true, but links don’t actually go anywhere. They retrieve information and download it. Buttons perform actions, but they don’t inherently “get” documents. While they can be used to get data, it’s often to change state of a current document, not to retrieve and render a new one. They can get data, in regards to the functionality of forms, but it continues to be within the context of updating a web document, not downloading an individual file. Long story short, the download attribute is unique to anchor links for a reason. download augments the inherent functionality of the link retrieving data. It side steps the attempt to render the file in the browser and instead says, “You know what? I’m just going to save this for later…”
-
What best describes a download? Is it a triggered action, and therefore should be in the domain of the <button> element? Or is it a destination, and therefore best described using an <a> element?
-
- Dec 2020
-
github.com github.com
-
The only solution that I can see is to ensure that each user gets their own set of stores for each server-rendered page. We can achieve this with the context API, and expose the stores like so: <script> import { stores } from '@sapper/app'; const { page, preloading, session } = stores(); </script> Calling stores() outside component initialisation would be an error.
Good solution.
-
-
sapper.svelte.dev sapper.svelte.dev
-
Preload functions are typically used to load data that the page depends on, hence its name. This avoids the user seeing the page update as it loads, as is typically the case with client-side loading.
-
-
www.npmjs.com www.npmjs.com
-
# fix a bug in one of your dependencies vim node_modules/some-package/brokenFile.js # run patch-package to create a .patch file npx patch-package some-package
I love how directly this allows you to make the change -- directly on the source file itself -- and then patch-package does the actual work of generating a patch from it. Brilliant.
Tags
Annotators
URL
-
-
github.com github.com
-
Maybe something more neutral just meaning a virtual element / no-element container would better express the intention? And regarding the syntax, maybe it would also feel less repetitive / boilerplaty than <svelte:slot slot="name" />... Maybe something like <svelte:fragment slot="name"> or <svelte:virtual slot="name">?
-
Also agree that <svelte:slot> is perhaps a little confusing since it replaces the slot attribute rather than the slot element, so <svelte:fragment> would make more sense
-
-
github.com github.com
-
Just to reiterate the discussion on the RFC, there was a suggestion that we change <svelte:slot slot="foo"> to <svelte:fragment slot="foo">, since it's the counterpart to a <slot> rather than an equivalent to it
-
-
github.com github.com
-
customizable communities that feel good
Tags
Annotators
URL
-
-
github.com github.com
-
It’s worth mentioning that Svelte limits its scope to being only a UI component framework. Like React, it provides the view layer, but it has more batteries included with its component-scoped CSS and extensible stores for state management. Others like Angular and Vue provide a more all-in-one solution with official routers, opinionated state management, CLIs, and more. Sapper is Svelte’s official app framework that adds routing, server-side rendering, code splitting, and some other essential app features, but it has no opinions about state management and beyond. Some devs prefer Svelte’s minimal approach that defers problems to userland, encouraging more innovation, choice, and fragmentation, and other devs prefer a more fully integrated toolkit with a well-supported happy path.
tag?: what scope of provided features / recommended happy path is needed?
-
Regardless of measurable impact, Svelte resonates with our emotions and it makes for a good story.
-
but really, the whole is what feels so good.
-
Making UIs with Svelte is a pleasure. Svelte’s aesthetics feel like a warm cozy blanket on the stormy web. This impacts everything — features, documentation, syntax, semantics, performance, framework internals, npm install size, the welcoming and helpful community attitude, and its collegial open development and RFCs — it all oozes good taste. Its API is tight, powerful, and good looking — I’d point to actions and stores to support this praise, but really, the whole is what feels so good. The aesthetics of underlying technologies have a way of leaking into the end user experience.
Tags
- a pleasure to use/work with
- feels like a breath of fresh air
- scope
- feels natural
- resonates
- aesthetics
- annotation meta: may need new tag
- excellent writing
- good point
- the whole (as opposed to the individual parts)
- something people like to use
- limited scope (doesn't try to be/do everything)
- picturesque
- Svelte
- makes for a good story
- feels good
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
A listener watches for an event to be fired. For example, a KeyListener waits for KeyEvents, a MessageListener waits for messages to arrive on a queue and so on. The handler is responsible for dealing with the event. Normally, listeners and handlers go hand-in-hand. For example, the KeyListener tells the ExitHandler that "the letter Q was pressed" and the handler performs logic such as cleaning up resources and exiting the application gracefully. Similary a ButtonClickListener would tell the same ExitHandler that the "Exit button was clicked". So, in this case you have two different events, two different listeners but a single handler.
You can use the same handler for multiple events/listeners.
-
The most basic difference is the association Listener is associated with Event Source (Ex: key board) Handler is associated with an Event (Ex: keydown)
-
-
-
Trying to find a new day job is full-time work
Tags
Annotators
URL
-
-
marked.js.org marked.js.org
-
Please use a sanitize library, like DOMPurify (recommended), sanitize-html or insane on the output HTML!
-
- Nov 2020
-
news.ycombinator.com news.ycombinator.com
-
There's a huge area of seemingly obvious user-centric products that don't exist simply because there isn't a working business model to support it.
-
-
acorwin.com acorwin.com
-
No program is an island. Every program has to hook into the operating system at some point, if nothing else.
-
-
www.reddit.com www.reddit.com
-
Svelte by itself is great, but doing a complete PWA (with service workers, etc) that runs and scales on multiple devices with high quality app-like UI controls quickly gets complex. Flutter just provides much better tooling for that out of the box IMO. You are not molding a website into an app, you are just building an app. If I was building a relatively simple web app that is only meant to run on the web, then I might still prefer Svelte in some cases.
-
-
uxdesign.cc uxdesign.cc
-
That’s how developers create buttons — they add padding to their div containers, not heights.
-
You should always take the line hight of the font you are using and add a unit to it. For example: “My button’s label has a line height of 20px and vertical padding of 8px”.
-
Choose sentence case or title case over uppercase. (This being said, Material Design does use buttons with uppercase labels.)
-
-
github.com github.com
-
For use$ since svelte is never going to support actions for components, i designed something that reminds React hooks that will in some ways replace this feature.
Isn't that what use$ is trying to do already? How is that "something that reminds React hooks" any different? Will be interested to see...
-
from my point of view, it is (by far) the best way, to build a layer on top https://github.com/material-components/material-components-web . This is also the path that the Angular Material team has taken, although they have already made a huge effort to create the components themselves.
-
-
-
As mentioned in #2937, this is the sort of thing that happens when you have two copies of Svelte's internal scheduler running. If you're importing the compiled version of an external Svelte component into another Svelte component, this is what you end up with. There's a svelte field in package.json that's respected by rollup-plugin-svelte and which is intended to point at the uncompiled Svelte source, so that the external component can be bundled together with the main app, without any duplicated internals.
-
is not required to point to "svelte": "src/main.html" if you're bundling for es, "module": "dist/main.mjs" would suffice. I mean, it's a good thing to provide a single file, not the whole sources again.
-
-
courses.lumenlearning.com courses.lumenlearning.com
-
positive feedback loops, in which a change in a given direction causes additional change in the same direction.For example, an increase in the concentration of a substance causes feedback that produces continued increases in concentration. negative feedback loops, in which a change in a given direction causes change in the opposite direction.For example, an increase in the concentration of a substance causes feedback that ultimately causes the concentration of the substance to decrease.
-
-
-
Addition; Please add this variables to environment if you don’t want to change code. This is a better option. Add RAILS_ENV=production , NODE_ENV=production, RAKE_ENV=production
-
-
commons.wikimedia.org commons.wikimedia.org
-
www.youtube.com www.youtube.com
-
Gas engines are so complicated/intricate/messy. I wish we could just use electric motors for everything. Clean, simple, and maintenance-free.
Tags
Annotators
URL
-
-
support.google.com support.google.com
-
webpack.js.org webpack.js.orgConcepts1
-
By default the current directory is used, but it's recommended to pass a value in your configuration. This makes your configuration independent from CWD (current working directory).
-
-
cs3mesh4eosc.eu cs3mesh4eosc.eu
Tags
Annotators
URL
-
-
stats.idre.ucla.edu stats.idre.ucla.edu
-
Linear mixed models are an extension of simple linear models to allow both fixed and random effects, and are particularly used when there is non independence in the data, such as arises from a hierarchical structure
-
-
serverfault.com serverfault.com
-
You may not want to go straight to that number and cause the kernel to allocate memory to track a million user file watch slots; instead, just take the current value and double it until the problem stops occurring.
-
-
stackoverflow.com stackoverflow.com
-
Never use x && y || z when y can return a non-zero exit status.
-
-
stackoverflow.com stackoverflow.com
-
Man, for some reason, I really like this answer. I recognize it's a bit more complicated, but it seems so useful. And given that I'm no bash expert, it leads me to believe that my logic is faulty, and there's something wrong with this methodology, otherwise, I feel others would have given it more praise. So, what's the problem with this function? Is there anything I should be looking out for here?
I think the main thing wrong with it is the eval (which I think can be changed to
$("$@")
and it's pretty verbose.Also, there are more concise ways to do it that would probably appeal more to most bash experts...
like set -x
and it does unnecessary things: why save output to a variable? Just let output go to where it would normally go...
So yeah, I can see why this solution isn't very popular. And I'm rather surprised by all the praise comments it's gotten.
-
If you were to check the return status of every single command, your script would look like this:
Illustrates how much boilerplate set -e saves you from.
Update: Oops, if you read a comment further below, you learn that:
Actually the idiomatic code without
set -e
would be justmake || exit $?
True that.
Tags
- good point
- boilerplate
- hasn't caught on / gained popularity
- good illustration (textual)
- good example
- why isn't this more popular?
- bash: error handling
- comparison
- why isn't this more common/the norm?
- good question
- shorthand
- syntactic sugar
- differences
- why aren't people talking about/asking this?
Annotators
URL
-
-
mywiki.wooledge.org mywiki.wooledge.org
-
true && { echo true; false; } || { echo false; true; }
-
true && ((i++)) || ((i--))
-
-
github.com github.com
-
obviously it's too late, but it's a good practice to keep the 3rd party dependencies mirrored in your own infrastructure :) There is NO GUARANTEE that even a huge site (like launchpad for downloading DEBs) won't go down over a period of time.
-
docker build --cache-from=base_image:2.2.1,custom-gource:0.1 . -t custom-gource:0.2
-
So let's say we pull down evil/foo which is FROM ubuntu followed by RUN apt-get update except with a small surprise included in the image. Subsequent builds using those same commands will be compromised.
-
-
guides.rubyonrails.org guides.rubyonrails.org
-
which are passed onto controller actions.
onto => on to
-
-
github.com github.com
-
With the advent of JavaScript modules (import and export), it's possible to build libraries that are tree-shakeable. This means that a user of your library can import just the bits they need, without burdening their users with all the code you're not using.
-
Avoid transpilers like Babel and Bublé (and if you're using TypeScript, target a modern version of JavaScript)
-
Don't create instances of things on initial evaluation — instantiate lazily, when the functions you export are called
-
-
-
this is the problem with that method.
-
-
stackoverflow.com stackoverflow.com
-
I would suggest that if you want the behaviour you get when you specify initial-scale=1, then specify initial-scale=1.
-
-
github.com github.com
-
I wondered about that. But as you mention, the control flow makes it tricky, because it's not really a template literal — it's a DSL. I thought perhaps it's better to have something that's explicitly different, than something a bit 'uncanny valley'.
-
-
github.com github.com
-
That said, supporting this syntax on elements as well as components could make sense.
Tags
Annotators
URL
-
-
serverfault.com serverfault.com
-
Decode of jq command:
-
- Oct 2020
-
github.com github.com
-
Start by reading this post (Final Form + Fonk)
-
-
-
The most dangerous kind of assumption is the one we don’t know we have. In Rumsfeldian, that’s an “Unknown unknown.”
-
-
english.stackexchange.com english.stackexchange.com
-
There are contradicting definitions: "dependence: one that is relied on", "dependency: something that is dependent on something else", "dependent: one that is dependent" which also says "archaic : DEPENDENCY" which is certainly the inverse of what is usually meant in technology... is it more correct to install the "dependences"? (wiktionary gives it as the plural)
-
-
-
This is a philosophical issue, I think. People (and presumably form libraries) have different definitions of what "dirty" means. Yours: "The field has ever been edited" Mine: "The value of the field is different from the initial value"
-
-
github.com github.com
-
I too have been confused by behavior like this. Perhaps a clearly defined way to isolate atomic units with synchronous reactivity would help those of us still working through the idiosyncrasies of reactivity.
-
-
-
I'm afraid there's only so much the docs & tutorials can do about something like this actually. When you first read them, you don't get Svelte well enough (since you're reading a tutorial...) for this to make sense to you. Then you try something, encounter a behaviour, question it, understand better... That's learning.
-
-
github.com github.com
-
medium.com medium.com
-
But for big projects it should work out to just apply this techniques to certain sub-folders in your project where this problems occurs, as-if they are stand alone libraries.
-
Examples of this include: requiring base classes or reading from imported variables that have not been initialized yet.
-
as soon as you have a (indirect) circular dependency, you might be interacting with a half loaded module in your code.
-
-
github.com github.com
-
Replaced nested `require` statements with `import` declarations for the sake of a leaner bundle. This entails adding empty imports to three files to guarantee correct ordering – see https://github.com/styled-components/styled-components/pull/100
-
-
stackoverflow.com stackoverflow.com
-
Restart from scratch. Create a new program, adding in only what is needed to see the problem. Use simple, descriptive names for functions and variables – don’t copy the names you’re using in your existing code.
-
Divide and conquer. If you’re not sure what the source of the problem is, start removing code a bit at a time until the problem disappears – then add the last part back.
-
-
-
danielmiessler.com danielmiessler.com
-
-
But many of these systems continue to re-request the same DTDs from our site thousands of times over, even after we have been serving them nothing but 503 errors for hours or days. Why are these systems bothering to request these resources at all if they don’t care about the response?
-
-
disqus.com disqus.com
-
Could you please explain why it is a vulnerability for an attacker to know the user names on a system? Currently External Identity Providers are wildly popular, meaning that user names are personal emails.My amazon account is my email address, my Azure account is my email address and both sites manage highly valuable information that could take a whole company out of business... and yet, they show no concern on hiding user names...
Good question: Why do the big players like Azure not seem to worry? Microsoft, Amazon, Google, etc. too probably. In fact, any email provider. So once someone knows your email address, you are (more) vulnerable to someone trying to hack your account. Makes me wonder if the severity of this problem is overrated.
Irony: He (using his full real name) posts:
- Information about which account ("my Azure account is my email address"), and
- How high-value of a target he would be ("both sites manage highly valuable information that could take a whole company out of business...")
thus making himself more of a target. (I hope he does not get targetted though.)
-
-
github.com github.com
-
One of Svelte's advantages, for me, is that I can test out ideas with relatively few lines of code. the #with feature could save me from adding a separate component for the content of an #each loop. I get frustrated when I have to create a new file, move the content of the #each clause, import it as a component, and add attributes and create exports for that, and implement events to send messages back, and event handlers, when I just wanted to test a small feature.
-
-
final-form.org final-form.org
-
Returns a Promise<?Object> that resolves with no value on success or resolves with an Object of submission errors on failure. The reason it resolves with errors is to leave rejection for when there is a server or communications error.
-
-
final-form.org final-form.org
-
Wondering how to get field state from multiple fields at once? People coming from Redux-Form might be wondering where the equivalent of Redux Form's Fields component is, as a way to get state from several fields at once. The answer is that it's not included in the library because it's so easy to write one recursively composing Field components together.
-
-
www.learnrxjs.io www.learnrxjs.ioSubjects1
-
You can think of this as a single speaker talking at a microphone in a room full of people. Their message (the subject) is being delivered to many (multicast) people (the observers) at once.
Tags
Annotators
URL
-
-
en.wikipedia.org en.wikipedia.org
-
One of the significant differences between the two is that a call to a partially applied function returns the result right away, not another function down the currying chain; this distinction can be illustrated clearly for functions whose arity is greater than two.
-
As such, curry is more suitably defined as an operation which, in many theoretical cases, is often applied recursively, but which is theoretically indistinguishable (when considered as an operation) from a partial application.
-
-
github.com github.com
-
Also, if you don't put that implementation of URLSearchParams in the global scope you're not using it as a polyfill but a ponyfill, and those are meant for your code, not for external dependencies.
first sighting: ponyfill
-
-
humanwhocodes.com humanwhocodes.com
-
JavaScript is, of course, a dynamic language that allows you to add and remove objects and their members at any point in time. For many, this is precisely why they enjoy the language: there are very few constraints imposed by the language.
-
Once again, this isn’t good or bad, it’s just the most efficient way to create something that is similar to something else
-
This isn’t to say that multiplying code is good or bad – it’s a characteristic of all code regardless of quality.
-
For years, I’ve shared with friends and clients what I call the bunny theory of code. The theory is that code multiplies when you’re not looking, not unlike bunnies that tend to multiply when you’re not looking.
Tags
- applicable
- JavaScript
- characteristic/property/attribute/feature
- bunny theory of code
- duplication
- time wasters
- when you're not looking
- inherent to all
- inevitable
- programming languages
- inherent
- avoid extra/needless work
- good analogy
- not necessarily good or bad
- ubiquity
- funny
- good point
- better/superior solution/way to do something
- most efficient way
- analogy
- duplication of work/effort
- few constraints/restrictions/limitations
- prolific
- fun
Annotators
URL
-
-
svelte.dev svelte.dev
-
Not all application state belongs inside your application's component hierarchy. Sometimes, you'll have values that need to be accessed by multiple unrelated components, or by a regular JavaScript module.
-
A store is simply an object with a subscribe method that allows interested parties to be notified whenever the store value changes. In App.svelte, count is a store, and we're setting count_value in the count.subscribe callback.
-
-
svelte.dev svelte.dev
-
Just like elements can have children... <div> <p>I'm a child of the div</p> </div>...so can components. Before a component can accept children, though, it needs to know where to put them. We do this with the <slot> element.
-
-
formvalidation.io formvalidation.io
Tags
Annotators
URL
-
-
-
mixing the turing complete of javascript with the markup of HTML eliminates the readability of JSX so that it is actually harder to parse than a solution like hyperscript
-
andrewdeandrade commented on Jul 31, 2015
locked issues that I would comment on if I could: Can't react to comment because locked. Want to thumb up.
-
Of all the compile-to-languages, the one that strikes me as having the least merit is JSX. It's basically a ton of added complexity for the sake of what boils down to syntax. There are no real gains in terms of language semantics in JSX.
-
Supporting JSX out of the box is the engineering equivalent of Mozilla supporting DRM out of the box in FireFox.
-
I agree that "it feels gross" is a bad reason. "not paving a bad cowpath" is a much better reason.
Tags
- out of the box
- have a good reason
- bad combination/mixture/hybrid/frankenstein
- comparison with:
- persuasive arguments/explanation
- advantages/merits/pros
- not merited
- equivalent
- JavaScript
- do pros outweigh/cover cons?
- hyperscript
- paving cow paths
- Turing complete
- react-hyperscript
- DRM
- JSX
- good analogy
- see content below
- excellent writing
- not enough advantages/merits/pros to make it worthwhile
- good point
- Andrew de Andrade
- missing out on the benefits of something
- supporting something/feature
- persuasiveness
- hybrid/mixture
- minimal benefits
- analogy
- excellent technical writing
- good explanation
- locked issues that I would comment on if I could
- is it worth the effort?
- not good enough reason/rationale/explanation
Annotators
URL
-
-
github.com github.com
-
Create HyperText with JavaScript
I assume that's where the name "HyperScript" came from? A portmanteau?
-
-
github.com github.com
-
const { getByRole } = render(<input bind_value={text}>)
Directly compare to: https://hyp.is/T2NGMA5ZEeu2k6dW8hBd9g/github.com/kenoxa/svelte-htm
-
-
github.com github.com
-
const { getByRole } = render(html`<input bind:value=${text} />`)
Directly compare to: https://hyp.is/KXd5yA5ZEeu9_K_HXsDR2w/github.com/kenoxa/svelte-jsx
-
render(html`<${Button} on:click=${() => (clicked += 1)}>Click Me!<//>`)
Compared to https://github.com/kenoxa/svelte-jsx#api, this alows on:click instead of on_click.
So maybe this syntax allows for fewer workarounds overall?
-
-
softwareengineering.stackexchange.com softwareengineering.stackexchange.com
-
debt ... which is not a straight bad thing but something that could provide some "short term financing" get us to survive the project (how many of us could afford to buy a house without taking out the mortgage?).
-
Right, and if most uses of an FTP service use new FtpService() the one that sets an alternate port will stand out (service.SetPort(12345))
-
-
leiss.ca leiss.ca
-
Good risk management is inherently simple; adding too many complexities increases the likelihood of overlooking the obvious.
-
-
-
by using tagged templates we can inline function calls
(below)
-
-
github.com github.com
-
require('modules') in the browser
-
Use a node-style require() to organize your browser code and load modules installed by npm.
-
-
stackoverflow.com stackoverflow.com
-
-
Encoding examples:
-
Escaping is a subset of encoding: You only encode certain characters by prefixing a special character instead of transferring (typically all or many) characters to another representation.
-
-
www.onwebsecurity.com www.onwebsecurity.com
-
Escaping is a subset of encoding, where not all characters need to be encoded. Only some characters are encoded (by using an escape character).
-
-
2ality.com 2ality.com
-
trusktr herman willems • 2 years ago Haha. Maybe React should focus on a template-string syntax and follow standards (and provide options for pre-compiling in Webpack, etc).
Well anywho, there's other projects now like hyperHTML, lit-html, etc, plus some really fast ones: https://www.stefankrause.ne...
React seems a little old now (and the new Hooks API is also resource heavy).
• Share ›  Michael Calkins trusktr • 4 years ago • edited That's a micro optimization. There isn't a big enough difference to matter unless you are building a game or something extraordinarily odd.
• Share › −  trusktr Michael Calkins • 2 years ago True, it matters if you're re-rendering the template at 60fps (f.e. for animations, or for games). If you're just changing views one time (f.e. a URL route change), then 100ms won't hurt at all.
-
-
facebook.github.io facebook.github.io
-
However, this would lead to further divergence. Tooling that is built around the assumptions imposed by template literals wouldn't work. It would undermine the meaning of template literals. It would be necessary to define how JSX behaves within the rest of the ECMAScript grammar within the template literal anyway.
-
Template literals work well for long embedded DSLs. Unfortunately the syntax noise is substantial when you exit in and out of embedded arbitrary ECMAScript expressions with identifiers in scope.
-
Why not Template Literals?
Tags
- javascript: tagged template literals
- controversial
- good question
- JSX
- why not?
- benefiting from shared tooling that can be reused
- DSL
- good point
- non-standard
- verbose/noisy
- substantial
- syntax noise
- divergence
- undermine
- ECMAScript standard
- exceptions to the rule
- assumptions
- leverage the fact that tooling already exists
Annotators
URL
-
-
www.python.org www.python.org
-
Because the code in question predates the introduction of the guideline and there is no other reason to be modifying that code.
Tags
Annotators
URL
-
-
-
A program somewhat controlling it's own flow. That's the key feature that makes a programming language Turing complete.
-
-
medium.com medium.com
-
Virtual DOM is valuable because it allows you to build apps without thinking about state transitions, with performance that is generally good enough
-
Moreover, React team even removed the “highlight updates” feature from dev tools because people used to obsessively haunt wasted renders with no reasoning behind it
-
-
-
This would be like an executable proposal. I understand that it's beyond the original intent of having canonical patterns on the Svelte site, but it would facilitate the community to express their own patterns. Now that we have markdown preprocessors , the documentation itself can be an app.
-
I'm suggesting that the cookbook apps be self-contained & forkable. 3rd parties could host their own cookbook recipes, possibly using a forked cookbook from an already established pattern.
-
-
-
This seems crucial, for example for #if inside #each {#each boxes as box} {@const b = box?.a?.b} {#if b} <p>{b}</p> {/if} {/each}
-
About the argument against it, "{@const will make code less consistent ": I think the same is true now, since people can come up with very different ways of dealing with the "computed value inside each loop/if function" problem. Some extract components, some use functions, some will prepare the array differently beforehand.
-
This is exactly why I'm in favor of @const. Helpers are fine, except when they're not and turn into boilerplate.
-
Right, because those are the only 3 instances where new "scopes" are created, which means you're seeing data for (probably) the first time.
good point: means you're seeing data for (probably) the first time.
-
I like this, mostly because it allows me to write small components without creating another separate sub-component for holding the value simple computation. I get annoyed every time I need to create a component just to hold a variable, or even move the computation away from the relevant location. It reminds me of the days where variables in C had to be declared at the top of the function.
-
-
-
My experience is that components count increase very fast in Svelte, much faster than in Ractive.
-
Could I get your intuition for why that rule of thumb applies to svelte components but not Javascript functions? I tend to make heavy use of let x = e when writing normal Javascript, as I do in most other languages (though unlambda is a notable exception). How is svelte different?
-
-
svelte.dev svelte.dev
-
reactjs.org reactjs.org
-
Data fetching, setting up a subscription, and manually changing the DOM in React components are all examples of side effects.
-
-
-
If there was a place I thought reactivity would be weak, I embraced it and I worked on it until I was happy with the results.
-
-
-
Any variable referenced on the lines marked with $: is marked as a dependency of the derived variable.
-
It's possible to run a function whenever some reactive state changes using the useEffect hook. In the example we log the length of the todoList whenever it changes. The first argument to useEffect is the function we want to run, and the second is a list of reactive values to track - whenever one of these values changes the effect will run again.
-
-
svelte.dev svelte.dev
-
-
Proposed workarounds get particularly awkward for multiple stores
good example follows
-
-
dmitripavlutin.com dmitripavlutin.com
-
for...of is a gem because:
-
-
svelte.dev svelte.dev
-
-
Putting a browserlist in the project will send a false signal to users. Svelte is only a lib, not an application. The consumer / implementer will have to decide what level of support he wants, according to its constraints/userbase and adjust its build process and polyfills implementation.
Tags
Annotators
URL
-
-
developer.mozilla.org developer.mozilla.org
-
strict-origin: Only send the origin of the document as the referrer when the protocol security level stays the same (e.g. HTTPS→HTTPS), but don't send it to a less secure destination (e.g. HTTPS→HTTP).
-
- Sep 2020
-
github.com github.com
-
remaining: 0, callbacks: [] r: 0, // remaining outros c: [], // callbacks p: outros // parent group
Ugh. Why did he change this?
Similar question here: https://hyp.is/kayb_AN1EeuCb5OkL5-Yqg/github.com/sveltejs/svelte/pull/3209
Answer here: https://github.com/sveltejs/svelte/pull/3209
-
-
github.com github.com
-
Why the obfuscation of remaining to r and callbacks to c? This is fine for function-local variables but in this instance makes the code significantly harder to reason about? There is no notion of what c and r mean.
-
-
stackoverflow.com stackoverflow.com
-
From npm@5.2.0, npm ships with npx package which lets you run commands from a local node_modules/.bin or from a central cache.
-
By default, npx will check whether <command> exists in $PATH, or in the local project binaries, and execute that. Calling npx <command> when <command> isn't already in your $PATH will automatically install a package with that name from the NPM registry for you, and invoke it. When it's done, the installed package won’t be anywhere in your globals, so you won’t have to worry about pollution in the long-term. You can prevent this behaviour by providing --no-install option.
-
A lot of instructions I read say things like npm install niftycommand and then niftycommand. But this will never work unless you have ./node_modules/.bin in your path, will it?
-
-
arxiv.org arxiv.org
-
Rostami-Tabar, B., Ali, M. M., Hong, T., Hyndman, R. J., Porter, M. D., & Syntetos, A. (2020). Forecasting for Social Good. ArXiv:2009.11669 [Cs]. http://arxiv.org/abs/2009.11669
-
-
github.com github.com
-
using modulesOnly behaves exactly as expected when it warns you that the listed npm libraries do not use the ES6 format and are in fact ignored. This option is meant as a way to determine if you still have commonjs libraries in your dependencies that require special treatment via rollup-plugin-commonjs. Your code will probably not work since the listed dependencies will be missing. You should remove modulesOnly and instead add rollup-plugin-commonjs.
-
-
stackoverflow.com stackoverflow.com
-
Why do I need a global variable? Is the global requirement from ES6 modules (I'd have thought modules would be in a functional scope) or rollup?
-
-
rollupjs.org rollupjs.orgRollup2
-
The difference between default and named affects how other people can consume your bundle. If you use default, a CommonJS user could do this, for example:
include the following content
-
In other words for those tools, you cannot create a package interface where const lib = require("your-lib") yields the same as import lib from "your-lib". With named export mode however, const {lib} = require("your-lib") will be equivalent to import {lib} from "your-lib".
-
-
github.com github.com
-
globals are assumed to have their field value on the window object and can be referenced inside the bundle by their field name globals: { name: 'Value', }, assumes that some other script tag or whatever establishes window.Value and the emitted umd bundle for example, calls the factory like factory(global.Value). So globals is just stuff to bring into the factory on the globals object. It doesn't even make it "global" inside the bundle. Basically, the resolver does not check the globals object during the loading process. The resolver needs to be told how to link these globals and that's what the external option is for. external: ['name'], Then you can reference it like import myName from 'name'; myName();
-
we've learned why you might want to use external but not globals: libraries. We've started to factor some of our client-side JS as libraries to share between projects. These libraries import $ from 'jquery'. However they don't want to presume how that import might be "fulfilled". In most projects it's fulfilled from a global i.e. a script loaded from a CDN. However in one project it's fulfilled from a local copy of jQuery for reasons I won't get into. So when these libraries bundle themselves for distribution, as ES6 modules, they mark 'jquery' as an external and not as a global. This leaves the import statements in the bundle. (Warning: Don't bundle as an IIFE or UMD, or Rollup will guess at fulfilling the import from a global, as @Rich-Harris mentions above.)
-
-
github.com github.com
-
Luckily, there is absolutely no good reason not to use strict mode for everything — so the solution to this problem is to lobby the authors of those modules to update them.
-
-
codingwithspike.wordpress.com codingwithspike.wordpress.com
-
Then it would tell NPM that “if a package lists me as a dependency, then assume that package also has a dependency on PackageB”.
-
To make this “if you install me, you better also install X, Y, and Z!” problem easier, peerDependencies was introduced.
-
-
github.com github.com
-
When the message say function was called outside component initialization first will look at my code and last at my configuration.
-
-
-
While there is some precedence in other frameworks for using as, the word doesn't fit well. Since you are adding functionality to elements I like the word add better (and it only has 1 more character).
-
<slot ref:img data-visible="{{visible}}" /> In the above everything on <slot> is lost since slot is a space in the HTML, not an actual element. How could we translate this to zero or ten elements inside the slot?
But I think this is a solved problem with current Svelte: just pass the lets to the slot content, and the slot content can decide how to pass those let props on to any or all of its child elements as it sees fit...
-
enhancers
-
-
github.com github.com
-
one problem with 'behavior' is that's the terminology we use to describe all of a component's encapsulated logic — methods, transitions, etc.
-
-
-
Is there a good way to do this given the compiler won't know at build time what events are needed? Should I make a wrapper that does addEventListener myself with a bind:this? Would be nice if Svelte could handle dynamic events though.
-
-
-
-
pressbooks.online.ucf.edu pressbooks.online.ucf.edu
-
here you can write your introduction.
Commentary
-
-
github.com github.com
-
Yes, they do but none of them allow arbitrary javascript anywhere in the template it is finely controlled. This deviates from that, in fact that is it's defining feature.
Tags
Annotators
URL
-
-
-
We should also allow passing unrecognised props to the rendered component. eg: tabindex might be required on some instances of a component, and not all. Why should developers have to add tabindex support to their components just that it may potentially be used
Glad to hear this is solved now: $restProps
-
The language should work for developers, not the other way around.
-
-
github.com github.com
-
Adding my 2 cents to the discussion. Adding a class prop to a component doesn't necessarily mean it should apply the style to the root element, but it makes sense that it should apply it the main element visually. Let's take a modal component as an example.
-
You're not trying to pass a class to a dom element. You're passing a class to a component. It's up to the component to define what that means for the components use case. In most cases it would be passed to a dom element.
-
That is, if I remove class={className} from the Child component, and/or remove the class/className prop entirely, then the class:active syntax doesn't have any effect since nothing is rendering the class prop anywhere.
Tags
Annotators
URL
-
-
css-tricks.com css-tricks.com
-
I don’t want my source to be human-readable, not for protective reasons, but because I care about web performance more. I want my website to arrive at light speed on a tiny spec of magical network packet dust and blossom into a complete website. Or do whatever computer science deems is the absolute fastest way to send website data between computers. I’m much more worried about the state of web performance than I am about web education. But even if I was very worried about web education, I don’t think it’s the network’s job to deliver teachability
-
-
svelte.dev svelte.dev
-
if the idea of using a template language makes you shudder — your fears are misplaced, but that's a topic for another day
-
-
github.com github.com
-
For example, you might want to use the browser’s knowledge of the user’s current time zone to group a collection of elements by date.
Tags
Annotators
URL
-
- Aug 2020
-
medium.com medium.com
-
Think of useRef as a useState that does not trigger a re-rendering of our component.
-
-
svelte.dev svelte.dev
Tags
Annotators
URL
-
-
material.io material.ioDialogs1
-
Dialogs are purposefully interruptive, so they should be used sparingly.
Tags
Annotators
URL
-
-
psyarxiv.com psyarxiv.com
-
Johnson, Samuel Gregory Blane. ‘Dimensions of Altruism: Do Evaluations of Prosocial Behavior Track Social Good or Personal Sacrifice?’ Preprint. PsyArXiv, 22 August 2020. https://doi.org/10.31234/osf.io/r85jv.
-
-
meta.stackexchange.com meta.stackexchange.com
-
But it's easy to imagine that the caption was incorrect for too long because those who know the language, know where the mistake is, and those who don't, think that it's the correct way to spell it.
those who know the language, know where the mistake is, In other words, they can easily spot the mistake and no better than to repeat it themselves, but either are powerless or too lazy to actually fix it on SE.
and those who don't, think that it's the correct way to spell it. So those who should no better are inadvertently perpetuating the mistake and teaching others that it is an acceptable/correct usage.
-
Unless I just loginned, I agree it's "log in".
-
-
english.stackexchange.com english.stackexchange.com
-
I think the conjugation is particularly helpful to see why it should be two separate words: "log in" -> "logging in" -> "logged in"
-
You can also think about each one with the way we stress the different syllables slightly when we're speaking: "log in to host.com" sounds like "log + in + to host.com" (each word is pretty much evenly stressed) "log into host.com" sounds like "log + INto host.com" (the stress is on "in") "login to host.com" sounds like "LOGin + to host.com" (the stress is on "log")
I wouldn't have thought about using the way we pronounce it to make a point about grammar, but somehow it seems to help slightly to make the point.
-
Perhaps someone should give an example of when 'into' is ever correct. "Turn into bed" is definitely incorrect, unless one is morphing into the form of a bed. But what about "he fell into the hole", "she went into the house", or "Star Trek Into Darkness"?
-