Dart Sass is the primary implementation of Sass, which means it gets new features before any other implementation. It’s fast, easy to install, and it compiles to pure JavaScript which makes it easy to integrate into modern web development workflows.
- Nov 2020
-
-
-
-
github.com github.com
-
All standard UI events are forwarded.
-
class: '' - A CSS class string.
-
-
-
Feel free to subscribe to the issue (there's button in the right hand column) but do not comment unless you are adding value to the discussion. "Me too" and "+1" are not valuable, nor are use cases that have already been written in the comments (e.g., we know that you can't put <tr> or <dd> elements with a <div>).
-
It won't work in all use cases, but it's better than the div soup.
-
I run into this on almost every project and end up doing this as a workaround: :global([slot="content"]) This allows me to style that extra div in the component that contains the slots but it would be super nice to have <MyComponent slot="content"/> and eliminate that extra div
-
If this is getting implemented, I think I'll love to see both implemented. I can see a lot of use cases where I would like to encapsulate the component with additional wrappers and in another scenarios I would like to just use the component. Now i work around this using empty div but then at times it breaks the structure because of the div element and I'll have to add more class utilities to make it work. This will be a great addition for Svelte.
-
I don't like adding unnecessary divs.
-
-
github.com github.com
-
webpack sure wastes a lot of time when things go wrong.
-
-
github.com github.com
-
// replace css-loader with typings-for-css-modules-loader environment.loaders.get('moduleSass').use = environment.loaders.get('moduleSass').use.map((u) => { if(u.loader == 'css-loader') { return { ...u, loader: 'typings-for-css-modules-loader' }; } else { return u; } });
-
-
github.com github.com
Tags
Annotators
URL
-
-
web.archive.org web.archive.org
-
prettier.io prettier.io
-
Prettier’s printWidth option does not work the same way. It is not the hard upper allowed line length limit. It is a way to say to Prettier roughly how long you’d like lines to be. Prettier will make both shorter and longer lines, but generally strive to meet the specified printWidth. Remember, computers are dumb. You need to explicitly tell them what to do, while humans can make their own (implicit) judgements, for example on when to break a line. In other words, don’t try to use printWidth as if it was ESLint’s max-len – they’re not the same. max-len just says what the maximum allowed line length is, but not what the generally preferred length is – which is what printWidth specifies.
-
-
-
I also tried to use <!-- svelte-ignore unused-export-let --> before the script tag but still no chance.
-
-
github.com github.com
-
You can only adopt a workaround, which can be one of
-
-
github.com github.com
-
Just coming here to voice my agreement that these warnings are annoying and exist in other libraries as well. For me this happened with svelma. I didn't write the library code, so I don't have complete control over it even though I agree there is an argument to be had around whether I should be notified anyway. In either case, these warnings should be easily disabled since libraries don't always get updated over night.
-
-
github.com github.com
-
Maybe it's also a bug because every warning should be ignorable? Not sure.
-
I would like the compiler to add a property like canIgnore: false to the warning, if the warning cannot be disabled.
-
-
github.com github.com
-
Note that you can also use dynamic partials, that conditionally select the partial to render based on the value in the JSON.
-
-
github.com github.com
-
Obviously we shouldn't rush into anything. But changes like these are best made earlier on in a project's lifecycle, so I'm eager to hear what people think so that we can start making some progress.
-
The success of JSX has proved that the second curly is unnecessary. Moreover, a lot of people — particularly those who have been exposed to React — have a visceral negative reaction to double curlies, many of them assuming that it brings with it all the limitations of crusty old languages like Mustache and Handlebars, where you can't use arbitrary JavaScript in expressions.
Tags
- do it right/well the first time because it may be too hard to clean up/fix later if you don't
- unnecessary
- major changes are easier/best made earlier in project's life
- JSX
- expressions in templates
- connotations
- Svelte
- negative connotations
- visceral reaction
- ability to use any arbitrary expression
- syntax
Annotators
URL
-
-
www.benkuhn.net www.benkuhn.net
-
When you’re implementing a bad plan yourself, instead of having a mentor bail you out by fixing it, a few really useful things happen:You learn many more details about why it was a bad idea. If someone else tells you your plan is bad, they’ll probably list the top two or three reasons. By actually following through, you’ll also get to learn reasons 4–1,217.You spend about 100x more time thinking about how you’ll avoid ever making that type of mistake again, i.e., digesting what you’ve learned and integrating it into your overall decision-making.By watching my mistakes and successes play out well or badly over the course of months, I was able to build much more detailed, precise models about what does and doesn’t matter for long-term codebase health. Eventually, that let me make architectural decisions with much more conviction.
There's a benefit to embarking on a challenge without a more experienced authority to bail you out.
- You learn many more details about why it's a bad idea.
- The lessons you learn in terms of how to avoid the mistakes you made stick with you longer
(I would add that the experience is more visceral, it activates more modalities in your brain, and you remember it much more clearly.)
These types of experiences result in what the author calls more "detailed, precise models". For me they result in a sort of intuition.
-
-
-
Some of the verbs implemented by systemctl are designed to provide a high-level overview in a human readable format. All that information is available over dbus, and/or journalctl, systemctl show. We could provide that information in json format, but there's a second problem. Information and format of information printed by e.g. systemctl status is not stable. Since the output is not suitable for programmatic consumption anyway, there's no need to provide it in a machine readable format.
-
In principle, this information is already available through other means, but it is actually a fair amount of work to gather it in this form, and I think it could be useful to open it up to programmatic consumption.
-
Although I agree that -o json should return proper JSON, believe the proper way for external tools like SaltStack etc. to talk to systemd is DBus. See also saltstack/salt#20392 - everything else is more or less just hack-ish and prone to break easily.
-
-
github.com github.com
-
I'm not sure what's the best solution, but it could be a good idea to print the full path only at the end of the line, since it takes a lot of space, or to move it to a separate line.
-
-
jonudell.info jonudell.info
-
http://jonudell.info/h/tag-rename-02.mp4
Most people would embed a YouTube video. Nice to see no dependency on 3rd-party service here.
-
-
www.facebook.com www.facebook.com
-
People want to be able to choose which service they use to communicate with people. However, today if you want to message people on Facebook you have to use Messenger, on Instagram you have to use Direct, and on WhatsApp you have to use WhatsApp. We want to give people a choice so they can reach their friends across these networks from whichever app they prefer.We plan to start by making it possible for you to send messages to your contacts using any of our services, and then to extend that interoperability to SMS too. Of course, this would be opt-in and you will be able to keep your accounts separate if you'd like.
Facebook plans to make messaging interoperable across Instagram, Facebook and Whatsapp. It will be opt-in.
-
-
whatever.scalzi.com whatever.scalzi.com
- Oct 2020
-
www.julian.com www.julian.com
-
But what should you write about? Simply ask yourself, What's bothering you most right now? Write a post where you work through that—and get to a conclusion. This is how I start every time. Writing is therapy that you publish for the world to learn from.
-
-
www.julian.com www.julian.com
-
First, choose your topicThe best topic to write about is the one you can’t not write about. It’s the idea bouncing around your head that urges you to get to the bottom of it.You can trigger this state of mind with a two-part trick. First, choose an objective for your article:Open people’s eyes by proving the status quo wrong.Articulate something everyone’s thinking about but no one is saying. Cut through the noise.Identify key trends on a topic. Use them to predict the future.Contribute original insights through research and experimentation.Distill an overwhelming topic into something approachable. (This guide.)Share a solution to a tough problem.Tell a suspenseful and emotional story that imparts a lesson.Now pair that objective with a motivation:Does writing this article get something off your chest?Does it help reason through a nagging, unsolved problem you have?Does it persuade others to do something you believe is important?Do you obsess over the topic and want others to geek out over it too?That’s all that's needed: Pair an objective with a motivation. Now you have something to talk about.
-
-
www.scispike.com www.scispike.com
-
I came up with this solution by piecing together man pages and random google result. I was surprised at how many incomplete and inaccurate answers were out there. What may have been more surprising was the complete lack of a full intact solution.
-
-
meta.stackoverflow.com meta.stackoverflow.com
-
Looking at all those bearing, heading, orientation, navigation, position, direction, etc. I think we have a bigger problem here. Someone has decided how to use tag (e.g. orientation is about page orientation), but there are 100 other cases. Imho, to disallow misusing there should be no "heading", but rather "html-heading", "gps-heading", "whatelse-heading", which make mistakes impossible. So yes, "heading" should go.
-
-
github.com github.com
-
It took a lot of searching around to find that variable.
-
-
hub.docker.com hub.docker.com
-
docs.microsoft.com docs.microsoft.com
-
I'll want to generate, upload, and store a certificate for publishing NuGet packages.
-
-
www.typelit.io www.typelit.io
-
-
docs.gitlab.com docs.gitlab.com
-
By using deploy keys, you don’t have to set up a fake user account.
-
-
stackoverflow.com stackoverflow.com
-
I use a mutator and use it's changeValue function to 'change' the value of the relevant field (I supply the same value). This in turn notifies all relevant parties of the change to the form's state, and a validation is triggered.
Nearly duplicate annotation here: https://hyp.is/I2t56hjLEeuPXIsZG-jYog/xtzmf.csb.app/
-
If you have a better/simpler/"more official" solution, I'd still love to see it!
The "official" solution is to use submitErrors (see Erik's answer).
-
we update the validation schema on the fly (we had a similar case with a validation that needs to be included whenever some fetch operation was completed)
-
is this solution considered a hack or is something that we can use as an approved workaround in scenarios where we need to manually trigger validations?
-
The only tricky part is that the error will come back as meta.submitError, so you need to check for both when displaying your error.
-
The more official way to do this would be to run the check (you could even reuse this.validate) in onSubmit.
Tags
- missing feature leading to less-than-ideal workarounds
- I _guess_ this is how we do it (uncertainty; wish I knew the recommended/best way but for now I just need a way that works)
- cheating
- downsides/cons
- caveat
- not officially supported / you're on your own
- react-final-form: mutator
- official preferred convention / way to do something
- run-time dynamicness/generics vs. having to explicitly list/hard-code all options ahead of time
- abuse of feature
- validation schema
- kludge
- easy to forget
Annotators
URL
-
-
codesandbox.io codesandbox.io
-
export const validationSchema = { field: { account: [Validators.required.validator, iban.validator, ibanBlackList], name: [Validators.required.validator], integerAmount: [Able to update this schema on the fly, with:
React.useEffect(() => { getDisabledCountryIBANCollection().then(countries => { const newValidationSchema = { ...validationSchema, field: { ...validationSchema.field, account: [ ...validationSchema.field.account, { validator: countryBlackList, customArgs: { countries, }, }, ], }, }; formValidation.updateValidationSchema(newValidationSchema); }); }, []);
-
-
github.com github.com
-
I'd be happy to take on this issue, if no one else has up to this point!
-
But also, if you do want to use separate functions and have your dependencies still counted, you can make all of the relevant dependencies be arguments to those functions, so the compiler can see them in the reactive block.
-
-
www.basefactor.com www.basefactor.com
-
Focus on your application: forget about forms details like I'm dirty, field touched...
-
What would happen if we get the list from a rest api when the form component is mounted? That's an interesting topic, you can add a rule once a component has been mounted and update the associated validation schema.
-
Ok, I have seen that there are lot of built-in and third party validations, but sooner or later I will face a validation rule not covered by this buffet. Can I build a custom one? Of course you can!
-
On the other hand, handling form validation on your own can be tempting, but you have to cover scenarios like:
-
You can try to build a solution to tackle these issues on your own, but it will cost you time and money... why not use a battle-tested solution to handle all this complexity?
-
If you want to implement a form with a superb User Experience, you have to take care of many variables:
-
Form validation can get complex (synchronous validations, asynchronous validations, record validations, field validations, internationalization, schemas definitions...). To cope with these challenges we will leverage this into Fonk and Fonk Final Form adaptor for a React Final Form seamless integration.
-
Managing Form State (holding field information, check if a control has been touched, if the user has clicked the submit button, who owns the current focus...) can be tedious and prone to errors. We can get help from React Final Form to handle these challenges for us.
Tags
- form validation library
- form design
- easy to get wrong
- integration
- too hard/difficult/much work to expect end-developers to write from scratch (need library to do it for them)
- run-time dynamicness/generics vs. having to explicitly list/hard-code all options ahead of time
- form validation
- adapter
- react-final-form
- tedious
- can't keep entire system in your mind at once (software development) (scope too large)
- reinventing the wheel / not invented here
- user experience
- a lot of things to consider
- can't support everything / all cases
- extensibility
- flexibility
- don't write your own
- difficult/hard problem
- not considering all use cases
- fonk (form validation library)
- complexity
Annotators
URL
-
-
xtzmf.csb.app xtzmf.csb.app
-
Use the same value that was submitted, which ensures that a 'change' is triggered even though the value itself doesn't change. Therefore, the same value gets validated again.
Calling it "change" even though it didn't change is kind of cheating/abuse ... but I guess it's okay...??
mutateValue([name], state, { changeValue }) { // change the value to the same value, thus // triggering a revalidation of the same value changeValue(state, name, value => value); }
-
-
english.stackexchange.com english.stackexchange.com
-
In the context of software engineering, I've always used "dependent" and "dependee".
-
-
-
Oops, I had not read your original description closely enough.
-
But it sounds like the library could use some way to setTouched()
-
you took 4 hours to respond, so I implemented it myself
Tags
- too easy/simple/trivial for end-developers to write from scratch to expect (don't need library to do it for them; don't need to provide feature)
- should I build/implement/create this myself?
- software development: solving problem that affects yourself
- contributing: willing to attempt/try to implement it
- exports (functions/etc. exposed to outside world) (modules)
- whether maintainer or contributor should/will implement something
- investing time to really understand something
Annotators
URL
-
-
-
There's an issue #3368 for describing better what triggers reactive updates, as I do think there is some stuff we could be more explicit about
-
Anyway, If this is an expected behaviour, we should probably add an asterisk to the docs, describing the pitfall, because I believe many will be bitten by this.
-
-
github.com github.com
-
we do need to have this somewhere
-
-
github.com github.com
-
if you make a shallow copy, it works
-
-
www.postgresql.org www.postgresql.org
-
SQL regular expressions are a curious cross between LIKE notation and common (POSIX) regular expression notation.
-
-
nullprogram.com nullprogram.com
-
-
www.smh.com.au www.smh.com.au
-
Mr Dutton will renew his attack on Facebook and other companies for moving to end-to-end encryption, saying it will hinder efforts to tackle online crime including child sexual abuse.This month, Australia joined its "Five-Eyes" intelligence partners – the United States, Britain, New Zealand and Canada – along with India and Japan, in signing a statement calling on tech companies to come up with a solution for law enforcement to access end-to-end encrypted messages.
Countering child exploitation is an extremely important issue. It's a tough job and encryption makes it harder. But making encryption insecure is counter intuitive and has negative impacts on digital privacy. So poking a hole in encryption, while it can assist with countering child exploitation, can also inadvertently be helping, for example, tech-enabled domestic abuse.
Hopefully DHA understands this and thus have thrown it back at the tech companies to come up with a solution for law enforcement.
-
-
-
I have a feature spec to test the Javascript behavior of the blur event, sadly Capybara's native DSL doesn't seem to support it yet.
-
-
www.quantamagazine.org www.quantamagazine.org
-
nesslabs.com nesslabs.com
-
The idea of the hermeneutic circle is to envision a whole in terms how the parts interact with each other, and how they interact with the whole. That may sound a little bit out there, so let’s have a look at a concrete example.
This is a general concept, the rest of the article extrapolates the idea to the act of reading. This may be a stretch, since it implies that whatever can be broken into parts will belong to the hermeneutic circle, while this only applies to interpreting (text)
-
-
github.com github.com
-
-
This reactive statement is just used to have the store automatically subscribed and unsubscribed.
-
I'm not sure I understand the problem, everything you are describing is already possible.
-
Svelte right now has a lot of opportunities to have component state become out of sync with props.
-
I'm suggesting this is a problem generally. Users will not think of being out of sync with props
-
Svelte doesn't re-render, so you need to respond to component mount/dismount and prop changes separately as they are distinct concepts and never tied together, unlike in React.
Tags
- too quick to dismiss
- issues: not taking the time to really understand the issue before closing
- distinction
- different way of thinking about something
- 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)
- easy to get wrong
- UI library: reacting to prop changes
- I have this problem
- Svelte
- general problem
- issues: discuss more before closing
- abuse of feature
- easy to forget
- missing feature leading to less-than-ideal workarounds
- issues I'm watching
- a problem worth solving properly
- useEffect
- investing time to really understand something
- can we do even better?
- lifecycle callbacks
Annotators
URL
-
-
graphql-dotnet.github.io graphql-dotnet.github.io
-
I highly recommend setting a higher bound on the number of returned entities by each resolve function in your code.
-
-
github.com github.com
-
-
medium.com medium.com
-
withindex.js, we have a single source of truth, giving fine grained control on what we expose to the outside world.
-
The index.js file is the main entry point and imports and exports everything from internal.js that you want to expose to the outside world.
-
This does solve the problem, but now our project and API is structured differently. In large projects it might be very hard to determine how to pull this trick off, or even impossible!
-
In a large code base, this will result in moving imports randomly around until stuff just happens to work. Which is often only temporary, as a small refactoring or change in import statements in the future can subtly adjust the module loading order, reintroducing the problem.
Tags
- side effects
- having enough control over something
- single source of truth
- hard to find
- fine-grained control
- key point
- hard to see
- refactoring
- impossible
- exports (functions/etc. exposed to outside world) (modules)
- easy mistake to make
- difficult/hard problem
- not:
- code organization: internal module pattern
- equivalent
- advantages/merits/pros
- technically impossible
Annotators
URL
-
-
-
To silence circular dependencies warnings for let's say moment library use: // rollup.config.js import path from 'path' const onwarn = warning => { // Silence circular dependency warning for moment package if ( warning.code === 'CIRCULAR_DEPENDENCY' && !warning.importer.indexOf(path.normalize('node_modules/moment/src/lib/')) ) { return } console.warn(`(!) ${warning.message}`) }
-
-
-
Any software that makes HTTP requests to other sites should make it straightforward to enable the use of a cache.
-
Take responsibility for your outgoing network traffic If you install software that interacts with other sites over the network, you should be aware how it works and what kind of traffic it generates. If it has the potential to make thousands of requests to other sites, make sure it uses an HTTP cache to prevent inflicting abuse on other sites.
-
Identify your user agents When deploying software that makes requests to other sites, you should set a custom User-Agent header to identify the software and provide a means to contact its maintainers. Many of the automated requests we receive have generic user-agent headers such as Java/1.6.0 or Python-urllib/2.1 which provide no information on the actual software responsible for making the requests.
-
-
-
-
It is not appropriate to use these document types for live content. These are made available only for download, to support local use in development, evaluation, and validation tools. Using these versions directly from the W3C server could cause automatic blockage, preventing them from loading. If it is necessary to use schemata in content, follow guidelines to avoid excessive DTD traffic. For instance, use caching proxies to avoid fetching the schema each time it is used, or ensure software uses a local cache, such as with XML catalogs.
-
-
svelte.dev svelte.dev
-
whenValueChanges whenValueBecomes
-
-
svelte.dev svelte.dev
-
A simple rule of thumb: the name of the updated variable must appear on the left hand side of the assignment. For example this... const foo = obj.foo; foo.bar = 'baz';...won't update references to obj.foo.bar, unless you follow it up with obj = obj.
-
-
en.wikipedia.org en.wikipedia.org
-
Longstanding controversy surrounds the meaning of the term "hacker". In this controversy, computer programmers reclaim the term hacker, arguing that it refers simply to someone with an advanced understanding of computers and computer networks[5] and that cracker is the more appropriate term for those who break into computers, whether computer criminals (black hats) or computer security experts (white hats).
-
-
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
-
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.
-
-
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.
-
-
stackoverflow.com stackoverflow.com
-
Looks like the problem is that debounce defaults to waiting for 0 ms ... which is completely useless!
It would be (and is) way to easy to omit the 2nd parameter to https://lodash.com/docs/4.17.15#debounce.
Why is that an optional param with a default value?? It should be required!
There must be some application where a delay of 0 is useless. https://www.geeksforgeeks.org/lodash-_-debounce-method/ alludes to / implies there may be a use:
When the wait time is 0 and the leading option is false, then the func call is deferred until to the next tick.
But I don't know what that use case is. For the use case / application of debouncing user input (where each character of input is delayed by at least 10 ms -- probably > 100 ms -- a delay of 0 seems utterly useless.
-
It looks like you accidentally passed resolve() (immediately invoking the function) directly to setTimeout rather than passing a function to invoke it. So it was being resolved immediately instead of after a 1000 ms delay as intended.
I guess this is the "immediately invoked function" problem.
Not to be confused with: immediately invoked function expression. (Since it is a regular named function and not a function expression.)
-
You should not create a new debounce function on every render with: return new Promise(resolve => { debounce(() => resolve(this.getIsNameUnique(name)), 2000); }); Instead you should just wrap your whole function isNameUnique with the debounce (see my sandbox). By creating a new debounce function on every hit, it cannot 'remember' that is was called or that is will be called again. This will prevent the debouncing.
-
-
stackoverflow.com stackoverflow.com
-
_.debounce creates a function that debounces the function that's passed into it. What your s.search function is doing is calling _.debounce all over again every time s.search is called. This creates a whole new function every time, so there's nothing to debounce.
-
I run s.search() by typing into an input box, and if I type gibberish very quickly, the console prints out "making search request" on every key press, so many times per second -- indicating that it hasn't been debounced at all.
-
they're not invoking the function that _.debounce returns
-
-
final-form.org final-form.org
-
If you define a variable outside of your form, you can then set the value of that variable to the handleSubmit function that 🏁 React Final Form gives you, and then you can call that function from outside of the form.
-
-
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
-
-
ponyfoo.com ponyfoo.comPony Foo1
-
Sometimes we can’t implement a solution that’s fully spec-compliant, and in those cases using a polyfill might be the wrong answer. A polyfill would translate into telling the rest of the codebase that it’s okay to use the feature, that it’ll work just like in modern browsers, but it might not in edge cases.
-
-
github.com github.com
-
Use ponyfill.com for linking here.
Tags
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
"doesn't work" is meaningless
-
-
-
Using the keyboard arrows, navigate down the suggestion list to the item(s) you want to remove from the Chrome autofill suggestions With the suggestion highlighted, use the appropriate keystroke sequence to delete the Chrome suggestion:
Linux: Shift + Delete
-
-
stackoverflow.com stackoverflow.com
-
FI:
I assume "FI" means "for instance"
-
-
humanwhocodes.com humanwhocodes.com
-
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.
-
Anyone who’s ever worked with me knows that I place a very high value on what ends up checked-in to a source code repository.
-
The reason for this is very simple: once code gets checked-in, it takes on a life of its own.
-
Checking in is akin to sharing your code with others, and once out in the world, it’s hard to predict what that code will do.
Tags
- better/superior solution/way to do something
- most efficient way
- applicable
- code quality
- avoid extra/needless work
- ubiquity
- inherent to all
- quality
- can't effectively predict/forecast
- quality of what is pushed/published to repository
- duplication
- valued highly
- characteristic/property/attribute/feature
- not necessarily good or bad
- once published/shared/online can't control what happens to it (copied/used)
- time wasters
- outside of our control
- duplication of work/effort
- inevitable
- inherent
Annotators
URL
-
-
-
I'm okay with an overall design that allows people to plugin the parts they need in order to be able to generically support a compile-to-javascript language, but to bake in support for one singular solution because its popular is simply bad engineering.
-
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.
-
Furthermore, JSX encourages bad non-dry code. Having seen a lot of JSX over the past few months, its encourages copypasta coding.
-
I know where you're coming from, and to a degree, I think you're right.
-
If the react cargo cult didn't have the JSX cowpath paved for them and acclimated to describing their app interface with vanilla javascript, they'd cargo cult around that. It's really about the path of least resistance and familiarity.
-
hyperscript is much simpler to refactor and DRY up your code than with JSX, because, being vanilla javascript, its easier to work with variable assignment, loops and conditionals.
-
The only "issue" it has is that its unfamiliar. People have been working with HTML for years and are comfortable with it. That's basically the only reason that people find it more readable. If you make an effort to spend sometime with hyperscript, it becomes as familiar and readable as jsx.
-
However, as a developer that uses JSX, I find it too useful/concise to give up in the name of syntax purity, especially when I know that what it translates to is still very isolated and computationally pure.
What does "isolated" mean in this case? Is it a different sense than how isolated is usually used in programming context?
What does "computationally pure" mean? Sounds like a bit of a vague weasel word, but this is an honest question of curiosity and wanting to understand/learn.
-
This is the problem with baking in support for frameworks with special cases in the codebase. You can never support all the frameworks. :-(
-
I've recently started playing with segmentio/deku, an alternative to React, and I'm also using Babel to transpile my js and jsx code.
Tags
- can't do everything
- is it worth the effort?
- javascript
- JSX
- making it easy to do the right thing
- too useful to give up
- making it easy for later refactoring
- alternative to:
- to understand others
- have a good reason
- transpiling
- UI library
- duplication
- favoring/catering to the needs of … over …
- can't support everything / all cases
- difficult/hard
- not a real/actual problem
- special cases
- it's just plain JavaScript
- adding special cases only for certain popular things but not others
- copy and paste programming
- comparison with:
- do pros outweigh/cover cons?
- copy and paste
- paving cow paths
- not merited
- UI library: syntax
- cargo cult
- path of least resistance
- hyperscript
- unfamiliar
- React
- readability: depends on familiarity
- Deku
- template language: bad: by not reusing existing language constructs; forced to reinvent equivalents which are inferior and unfamiliar
- familiar syntax
- due to historical reasons
- purity
- not enough advantages/merits/pros to make it worthwhile
- reuse existing language constructs
- alternative to mainstream way
- making it easy to do the wrong thing
- hypothetical/alternate history
- making it too easy to do the wrong thing
- doing something without knowing why/how it works
- comfortable because familiar
- minimal benefits
- JavaScript
- investing time to really understand something
- isolation (programming)
- hard to make it work in _all_ cases
- familiarity
- extensibility
- subjective
- plugins
- bad engineering
- encourages the wrong thing
- readability
- advantages/merits/pros
- template language vs. reusing existing language constructs
- it's just _
Annotators
URL
-
-
github.com github.com
-
The reason why we don't just create a real DOM tree is that creating DOM nodes and reading the node properties is an expensive operation which is what we are trying to avoid.
-
-
www.npmjs.com www.npmjs.comhyperx1
-
This module is similar to JSX, but provided as a standards-compliant ES6 tagged template string function.
-
-
www.merriam-webster.com www.merriam-webster.com
-
github.com github.com
-
if you think this project can help you or anyone else, you may star it on GitHub
-
For the sake of best compatibility we convert the className attribute to class for svelte.
Svelte refuses to standardize on any way to pass a CSS class. I thought className was actually the most common name for this prop though even in Svelte...
-
For event listeners we support the standard jsx naming convention onEventname (this is converted to on:eventname in svelte) as well.
-
We aim to support all svelte features. In some cases this is not possible. For those cases we provided feasible workarounds.
-
jsx currently does not allow to use : in attribute/property names. As a workaround every : can be replaced be _ (for example bind_value is converted to bind:value for svelte).
Tags
- React
- feature parity
- JSX
- lack of standard
- Svelte
- Svelte: how to affect child component styles
- asking someone to upvote something for you
- conversion (transform)
- design goals
- impossible
- Svelte: events
- React: events
- workarounds
- provided
- explicit goals
- equivalent/analogous/alternative ways to do something between 2 libraries/languages/etc.
- differences
- limitations leading to workarounds
- naming convention
- standard
Annotators
URL
-
-
github.com github.com
-
-
The goal is to bring element creation down to this logic:
-
In React 0.12 time frame we did a bunch of small changes to how key, ref and defaultProps works. Particularly, they get resolved early on in the React.createElement(...) call. This made sense when everything was classes, but since then, we've introduced function components. Hooks have also make function components more prevalent. It might be time to reevaluate some of those designs to simplify things (at least for function components).
-
However, in function components there really isn't much need for this pattern since you can just use JS default arguments
-
-
softwareengineering.stackexchange.com softwareengineering.stackexchange.com
-
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.
-
-
-
I recommend folks use https://github.com/shama/bel instead of this package; we've been working hard on it for the past two years to make sure it has all the features you could want to write inline HTML. Hope it's good; closing for now!
-
-
github.com github.com
-
github.com github.com
-
By default all content inside template strings is escaped. This is great for strings, but not ideal if you want to insert HTML that's been returned from another function (for example: a markdown renderer). Use nanohtml/raw for to interpolate HTML directly.
-
-
github.com github.com
-
Hyperscript syntax for React.js markup
-
-
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.
-
-
github.com github.com
-
Deku is a library for rendering interfaces using pure functions and virtual DOM.
-
It also aims to support only modern browsers to keep things simple.
-
-
www.agileconnection.com www.agileconnection.com
-
One of the inherent dangers of any form of iterative development is confusing iteration with oscillation.
-
-
www.python.org www.python.org
-
However, know when to be inconsistent -- sometimes style guide recommendations just aren't applicable.
-
When applying the guideline would make the code less readable, even for someone who is used to reading code that follows this PEP.
-
although this is also an opportunity to clean up someone else's mess
-
To be consistent with surrounding code that also breaks it (maybe for historic reasons)
-
-
developer.mozilla.org developer.mozilla.org
-
An onevent event handler property serves as a placeholder of sorts, to which a single event handler can be assigned. In order to allow multiple handlers to be installed for the same event on a given object, you can call its addEventListener() method, which manages a list of handlers for the given event on the object.
-
-
medium.com medium.com
-
Then at some moment I just stumbled upon limitations and inexpressiveness of templates and started to use JSX everywhere — and because JSX was not a typical thing for Vue I switched to React over time. I don’t want to make a step back.
-
But the vast majority of things that our apps are doing are just conditional and list rendering.
-
In my opinion it is okay to say your tool is revolutionary compared to existing ones. And it is hard to be fully unbiased about your own creation, I get it.
-
-
github.com github.com
-
Tables are not yet supported. If you love impossible to read regular expressions, submit a PR!
-
-
-
I suppose it all comes down to tooling. It should be easy to author a pattern. A set of implicit (possibly explicit) patterns to author patterns may be useful.
Tags
Annotators
URL
-
-
github.com github.com
-
Thank you to those who have failed many times, yet never gave up
Tags
Annotators
URL
-
-
docs.google.com docs.google.com
-
But it’s really hard to see, because our human brains struggle to think about this Clock function as something for generating discrete snapshots of a clock, instead of representing a persistent thing that changes over time.
-
-
-
A reasonably clean alternative would be to map a function over the array and use destructuring in the each loop: {#each [1, 2, 3, 4].map(n => ({ n, sqr_n: n * n })) as { n, sqr_n }} {sqr_n} {sqr_n / 2}<br> {/each}
-
-
github.com github.com
-
I discovered that a solution can be hacked using an {#if}, but a proper one would be nice:
-
-
tech.ebayinc.com tech.ebayinc.com
-
Every new variation to the view requires updating both the view model and the template. This holds true even for simple variations.
-
Offsetting the rules of a logic-less template requires a lot of helper methods.
-
Writing a logic-less template requires a bloated view model with comprehensive getters for the raw data. As a result, a messy and difficult-to-maintain view model usually accompanies logic-less templates.
-
that does not mean that I am advocating the other extreme–i.e., a templating language that allows a lot of logic. I find such templating languages, especially those that allow the host programming languages to be used inside the template, to be hard to read, hard to maintain, and simply a bad choice.
Tags
- boilerplate
- solving one problem introduces another
- duplication: need to update in multiple places
- co-location: not co-located
- duplication of work/effort
- logic in templates: allowing host programming language to be used in template
- arbitrary limitations leading to less-than-ideal workarounds
- hard to maintain
- logic in templates: logic-less
Annotators
URL
-
-
-
It's certainly something I've wanted to reach for prior
-
An alternative (maybe not good) would be to restrict {@const} to certain blocks like {#each} and {#if}. In both cases, it significantly reduces the "multiple ways to do the same thing" problem and avoids ergonomic and performance overhead of our current situation.
-
it also allows for more divergence in how people write there code and where they put their logic, making different svelte codebases potentially even more different due to fewer constraints. This last point is actually something I really value, I read a lot of Svelte code by a lot of different people and broadly speaking things look the same and are in the same places.
Tags
- software development: code organization: where does this code belong?
- convention
- idiomatic code style (programming languages)
- idiomatic pattern (in library/framework)
- "wanted to reach for"
- uniformity
- consistency
- programming: multiple ways to do the same thing
- strong conventions resulting in code from different code bases/developers looking very similar
Annotators
URL
-
-
-
I had this problem and figured out how to make something like this work with the compiler quirks.
-
-
svelte.dev svelte.dev
-
This is the Svelte version of this example: https://codesandbox.io/s/reactivity-react-responds-to-changing-props-forked-d2j44?file=/src/Label.js
-
-
nginx.org nginx.org
-
Hannah Stepanek annotated the hell out of this reference. I would do well to read what she had to say.
Tags
Annotators
URL
-
-
svelte.dev svelte.dev
-
Generally, you should read the value of a store by subscribing to it and using the value as it changes over time. Occasionally, you may need to retrieve the value of a store to which you're not subscribed. get allows you to do so.
-
-
github.com github.com
-
They even named the main file
react.jsso when converting/migrating components from React you could (at least some of the time, perhaps) simply leave some of the imports as-is:import {createHooks, useRef} from './react';
-
-
dylanvann.com dylanvann.com
-
the code is a bit verbose/convoluted
-
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.
-
When using React hooks there is no concept of onMount because the idea of only running some code on mount leads to writing non-resilient components, components that do one thing when they mount, and then don’t take prop changes into account.
-
Beautiful, except that switching albums does not update the PhotoGrid. This is not the automatic reactivity we were promised by Svelte.
Tags
- Svelte for someone coming from React
- easy to get wrong
- UI library: reacting to prop changes
- surprising
- Svelte
- confusing for newcomers
- not delivering on promise
- abuse of feature
- convoluted
- the natural assumption
- ugly/kludgey
- easy to forget
- missing feature leading to less-than-ideal workarounds
- easy to confuse (mix up)
- component design: resilient components
- easy mistake to make
- lifecycle callbacks
- false assumptions
- failed to deliver on expectations
- hard to understand
Annotators
URL
-
-
dylanvann.com dylanvann.com
-
Using another reactive statement with $effect we have Svelte automatically handle subscribing and unsubscribing to the store
-
I’d still be interested in Svelte making things easier so I’ve opened a feature request for Reactive statement cleanup functions.
Tags
- missing feature leading to less-than-ideal workarounds
- can we do even better?
- awkward workarounds
- cross-linking to issue
- take the extra time/effort to open an issue (in the appropriate project)
- Svelte: store: custom
- community (for a project or product)
- abuse of feature
- don't just complain; help improve/fix things
- cross-linking so readers can get the full context / see the outcome/resolution
Annotators
URL
-
-
github.com github.com
-
It provides several capabilities that are difficult to achieve with React alone, while being compatible with the newest features of React.
-
-
recoiljs.org recoiljs.org
-
For reasons of compatibility and simplicity, it's best to use React's built-in state management capabilities rather than external global state.
-
-
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
- overcoming preconceived opinions
- different way of thinking about something
- 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)
- paradigm shift
- Svelte
- getting a fresh perspective
- Svelte: action (use:)
Annotators
URL
-
-
rjlipton.wordpress.com rjlipton.wordpress.com
-
A “solution” to GR is more like a model in logic: it may satisfy a theory’s axioms but have other properties that are contingent (unless the theory is categorical, meaning that all of its models are isomorphic).
-
-
bookbook.pubpub.org bookbook.pubpub.org
-
Safiya Noble, Algorithms of Oppression (New York: New York University Press, 2018). See also Mozilla’s 2019 Internet Health Report at https://internethealthreport.org/2019/lets-ask-more-of-ai/.
-
-
blog.joinmastodon.org blog.joinmastodon.org
-
So that’s already a huge advantage over other platforms due the basic design. And in my opinion it’s got advantages over the other extreme, too, a pure peer-to-peer design, where everyone would have to fend for themselves, without the pooled resources.
Definitely something the IndieWeb may have to solve for.
-
-
www.economist.com www.economist.com
-
“INFORMATION RULES”—published in 1999 but still one of the best books on digital economics—Carl Shapiro and Hal Varian, two economists, popularised the term “network effects”,
I want to get a copy of this book.
-
-
-
In the Ars memorandi noua secretissima, published in 1500 or 1501,20 Jodocus Weczdorff de Triptis (Weimar) inserted an alphabetical list of words, similar to that of Celtis, but he simply suggested that it could be used as a memory house without any scope for our private associations. Moreover, the alphabetic table of Celtis was included in the famous Margarita philosophica nova of Gregor Reisch, which was probably the most popular handbook of the artes scholars in the fi rst two decades of the 16th century.
Books on memory that used Celtes' trick
-
“The Art of Memory in Late Medieval East Central Europe (Bohemia, Hungary, Poland): An Anthology,” co-written by Lucie Doležalová, Rafał Wójcik and myself.
-
-
-
In 1945 Jacques S. Hadamard surveyed mathematicians to determine their mental processes at work by posing a series of questions to them and later published his results in An Essay on the Psychology of Invention in the Mathematical Field.
I suspect this might be an interesting read.
-
-
myscript.com myscript.com
-
MyScript MathPad
This looks like something I could integrate into my workflow.
-
-
bookbook.pubpub.org bookbook.pubpub.org
-
In April of 2019, at a digital learning conference, Manuel Espinoza spoke with educators, technologists, and annotation enthusiasts about R2L.d-undefined, .lh-undefined { background-color: rgba(0, 0, 0, 0.2) !important; }.d-undefined, .lh-undefined { background-color: rgba(0, 0, 0, 0.5) !important; }1Nate Angell and “the role that Hypothesis plays in human rights work.”
Manuel Espinoza, “Keynote,” AnnotatED Summit, April 2, 2018, https://youtu.be/5LNmSjDHipM.
-
-
danallosso.substack.com danallosso.substack.com
-
Horwitz argued a fairly radical point, which I think never received wide enough recognition due to the subject matter and his extremely difficult (dense and dry) style. He said, “I seek to show that one of the crucial choices made during the antebellum period was to promote economic growth primarily through the legal, not the tax, system, a choice which had major consequences for the distribution of wealth and power in American society”
I'll have to add this book to my to read stack.
Tags
Annotators
URL
-
-
longviewoneducation.org longviewoneducation.org
-
Universal Design for Learning: Theory and Practice by Meyer, Rose, and Gordon (a book recognized as the core statement about UDL, which you can read for free) walks us through how educators actively change their practice to become more inclusive and helps us weigh choices in terms of how we create unnecessary barriers:
-
-
github.com github.com
-
Solid supports templating in 3 forms JSX, Tagged Template Literals, and Solid's HyperScript variant.
-