- Nov 2020
-
stackoverflow.com stackoverflow.com
-
If you want a reference to the global object that works in any context, you can read this from a directly-called function. const global = (function() {return this})();. This evaluates to window in the browser, self in a service worker and global in nodejs.
-
-
stackoverflow.com stackoverflow.com
-
If the client JS is disabled, then handleSubmit will never be executed and you have to care that your /api/fakeBackendRoute will handle the data exactly how the client would.
-
-
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.
-
Unfortunately it is not just the semantic that is broken. There are lot of things.For example if you look at some of the examples (https://flutter.github.io/samples/#/) - you can see that indeed there are some div and p tags but it is not entirely normal DOM elements. For example you can't even select text anywhere on the screen. And there are more and more little things like that.Just to be clear - Flutter for web is great, I'm happy it exists, but it is not comparable to React/Vue or Svelte.IMO Flutter for web is good to post live examples of Flutter code or maybe some last-minute-boss-request to make a web version of existing app, but for not for full-blown web app. :)
-
-
github.com github.com
-
All projects here are completely frozen, though feel free to fork and continue using them on your own.
-
-
github.com github.com
-
读了一遍收获不大,读懂的内容读之前已经懂的,不懂的看了还是不大懂,等日后再来吧
-
-
blog.hubspot.com blog.hubspot.com
-
One last bonus: CSS variables can be written in a way that makes it easier for human programmers to understand. If you just see hex code #93e9be, you won’t know what color it produces, while --brand-green makes clear the purpose of the variable.
-
-
developer.mozilla.org developer.mozilla.org
-
Fallback values aren't used to fix the browser compatibility. If the browser doesn't support CSS custom Properties, the fallback value won't help.
-
An additional benefit is semantic identifiers. For example, --main-text-color is easier to understand than #00ff00, especially if this same color is also used in other contexts.
-
-
uxdesign.cc uxdesign.cc
-
That’s how developers create buttons — they add padding to their div containers, not heights.
-
-
github.com github.com
-
passive: true instructs chrome that no body will call e.preventDefault() so chrome can optimized scrolling just because no body will call e.preventDefault and so there is no need to wait listeners...
-
-
github.com github.com
-
@monkeythedev can your work be used already? I would suggest not yet, i'm still doing core changes every day
-
-
www.metabase.com www.metabase.comMetabase1
-
seems interesting
-
-
www.quora.com www.quora.com
-
What was it like to be a software engineer at NeXT?
What was it like to be a software engineer at NeXT?
-
-
geoexamples.com geoexamples.com
-
After some attempts mapping with Svelte, I missed using canvas instead of SVG
-
-
timdeschryver.dev timdeschryver.dev
-
In the past, I tried to create some proof of concepts with svelte, but I usually ended up missing some of the features that RxJS provides. Now that I know that they complement each other well, I will grab this combination more often
-
Svelte makes the pit of success larger because it hides all of this from us at compile time.
-
At the start this is hard to get right, and bad practices will sneak into the codebase.
-
-
opinionatedgamers.com opinionatedgamers.com
-
I find the binding of Mini Express pleasant.
-
-
opinionatedgamers.com opinionatedgamers.com
-
What vaults this well past SNCF for me (setup time aside), is the limited company choice; it prevents a feedback loop of sorts where a game devolves into running each company in the ground.
-
-
www.snowpack.dev www.snowpack.devSnowpack1
-
Who’s Using Snowpack?
-
-
-
So handling the interop upfront will avoid users writing invalid ES6 and make sure that they write ES6 that loads CommonJS in the right way.
-
-
www.youtube.com www.youtube.com
-
If everyone did this, the repair shops would be out of business.
-
-
blog.joinmastodon.org blog.joinmastodon.org
-
While there have always been server listings on joinmastodon.org, this is a break from our previous practice of listing servers. Before the Server Covenant we pulled a list of servers from a 3rd party provider called instances.social. However, instances.social was a 3rd party and automated service. The one thing that it could not do was any kind of quality control as it simply listed every instance submitted–regardless of stability or their code of conduct. As Mastodon has grown it has become increasingly clear that simply listing every possible server was not in our interest as a project, nor was it in the interest in the majority of the communities running Mastodon.
To some level as an IndieWeb participant I'm doing this more manually by reading and individually adding people and their sites to my personal network one at a time. No one has yet moderated this process and to some extent it's sort of nice to have a more natural discovery process for protecting my own personal network.
-
-
www.styled-components.com www.styled-components.com
-
www.youtube.com www.youtube.com
-
Life of a Kubernetes API Request by Daniel Smith, Google
-
-
www.youtube.com www.youtube.com
-
Kubernetes Design Principles: Understand the Why
-
-
gist.github.com gist.github.com
-
There was a major refactoring in the resolver (https://github.com/webpack/enhanced-resolve). This means the resolving option were changed too. Mostly simplification and changes that make it more unlikely to configure it incorrectly.
Linked from: https://stackoverflow.com/a/36574982/47185
-
-
medium.com medium.com
-
Bringing this back to filtering, not only am I saving time and preserving focus by batch processing both the collection and the consumption of new content, I’m time-shifting the curation process to a time better suited for reading, and (most critically) removed from the temptations, stresses, and biopsychosocial hooks that first lured me in.I am always amazed by what happens: no matter how stringent I was in the original collecting, no matter how certain I was that this thing was worthwhile, I regularly eliminate 1/3 of my list before reading. The post that looked SO INTERESTING when compared to that one task I’d been procrastinating on, in retrospect isn’t even something I care about.What I’m essentially doing is creating a buffer. Instead of pushing a new piece of info through from intake to processing to consumption without any scrutiny, I’m creating a pool of options drawn from a longer time period, which allows me to make decisions from a higher perspective, where those decisions are much better aligned with what truly matters to me.
Using read-it later apps helps you separate collection from filtering.
By time-shifting the filtering process to a time better suited for reading, and removed from temptations, you will want to drop 2/3 of the content you save.
This allows you to "make decisions from a higher perspective"
-
-
stackoverflow.com stackoverflow.com
-
This is the real issue here, and it's a bug with chrome devtools, fixed in Chrome 46.
-
-
github.com github.com
-
If this PR merges and it has unforseen bugs / issues, I'm not sure anyone would have the time to jump in and fix it. So, that's why I'm being cautious about approving/merging it.
-
-
stackoverflow.com stackoverflow.com
-
And the App will be responsible for display a list of users adding/removing users of said list
-
-
github.com github.com
-
Tell you why tree-shaking fails, if it does.
-
What it doesn't do
Tags
Annotators
URL
-
-
-
Do you want to know how much it costs to make an app? Learn the cost to develop iOS & Android apps in 2020 and about the main influencing factors and indicators.
-
-
github.com github.com
-
I see this issue has 2 open PR's is this going to be finalized anytime soon?
-
-
github.com github.com
-
I guess I was just waiting for some interest from a maintainer, since there's not much point in wasting my time on developing this if the maintainers aren't even interested in this feature.
-
-
-
github.com github.com
-
Furthermore, how come there's a PR open since 3 months, at what seems to be the authoritative repo for Svelte?
-
-
github.com github.com
-
github.com github.com
-
There are a few intentional behavioral differences between Dart Sass and Ruby Sass. These are generally places where Ruby Sass has an undesired behavior, and it's substantially easier to implement the correct behavior than it would be to implement compatible behavior. These should all have tracking bugs against Ruby Sass to update the reference behavior.
-
Sass makes CSS fun again.
Tags
- reversible decisions
- intentional
- reverting a previous decision/change/commit
- makes it fun again
- get back on course
- Sass
- fun
- intentionally doing it differently / _not_ emulating/copying the way someone else did it
- learn from your mistakes
- don't let previous decisions/work constrain you
- intentional/well-considered decisions
- reference implementation
Annotators
URL
-
-
css-tricks.com css-tricks.com
-
When you use a function like color(). it’s impossible to know exactly where it was defined. Which @import does it come from?
-
-
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
-
Maybe it's also a bug because every warning should be ignorable? Not sure.
-
-
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.
-
-
medium.com medium.com
-
flash loan & hack
-
-
forum.makerdao.com forum.makerdao.com
-
flash loan & makerdao
-
-
-
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.
-
-
arxiv.org arxiv.org
-
-
measure system call
-
- Oct 2020
-
www.getcloudapp.com www.getcloudapp.com
-
Over 4 million people trust CloudApp
-
-
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.
-
-
rekt.ghost.io rekt.ghost.io
-
flash loans
Tags
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
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).
-
-
github.com github.com
-
I'd be happy to take on this issue, if no one else has up to this point!
-
-
www.basefactor.com www.basefactor.com
-
Focus on your application: forget about forms details like I'm dirty, field touched...
-
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
- difficult/hard problem
- integration
- form validation
- too hard/difficult/much work to expect end-developers to write from scratch (need library to do it for them)
- user experience
- fonk (form validation library)
- complexity
- react-final-form
- don't write your own
- a lot of things to consider
- form validation library
- tedious
- can't keep entire system in your mind at once (software development) (scope too large)
- reinventing the wheel / not invented here
- form design
- adapter
- easy to get wrong
Annotators
URL
-
-
www.youtube.com www.youtube.com
-
Unfortunately, it is an expression mired with a negative context because of how Rumsfeld used it to lie.
-
-
-
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)
- software development: solving problem that affects yourself
- exports (functions/etc. exposed to outside world) (modules)
- whether maintainer or contributor should/will implement something
- should I build/implement/create this myself?
- contributing: willing to attempt/try to implement it
Annotators
URL
-
-
dodoex.github.io dodoex.github.io
-
math is simple
Tags
Annotators
URL
-
-
github.com github.com
-
If that one somehow ends up being deemed an intended behavior rather than a bug, then it should definitely get explained in the docs too.
Tags
Annotators
URL
-
-
github.com github.com
-
I'm not sure yet how much of this is a bug.
Tags
Annotators
URL
-
-
-
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
-
This isn't a bug. Svelte's reactivity is triggered by assignment, so it won't re-render on mutations like array pushing.
-
We want arr.push(foo); arr = arr; to work, and this is a bug.
-
-
about.gitlab.com about.gitlab.com
-
gitlab Tech stack
-
-
-
Especially when rollup is configured with multiple outputs, I find this particular onwarn to be helpful in reducing warning clutter. It just displays each circular reference once and doesn't repeat the warning for each output:
-
I think my personal preference would be to see them all at once. Or maybe limit it to up to 10 messages and then list the count of how many more messages were not displayed. Pick your reaction
-
Another thing we could do to limit output would be to only every show the first circular dependency warning. I think we already do this for other types of warnings. Then you would need to tackle the warnings one-by-one, though.
-
-
medium.com medium.com
-
Modules from the following layer can require anything from all the previous layers, but not vice versa.
-
-
-
Note that these are not hyperlinks; these URIs are used for identification. This is a machine-readable way to say “this is HTML”. In particular, software does not usually need to fetch these resources, and certainly does not need to fetch the same one over and over!
-
You might think something like “don’t request the same resource thousands of times a day, especially when it explicitly tells you it should be considered fresh for 90 days” would be obvious, but unfortunately it seems not.
-
Any software that makes HTTP requests to other sites should make it straightforward to enable the use of a cache.
-
-
www.youtube.com www.youtube.com
-
multi-tenancy
-
-
www.qikqiak.com www.qikqiak.com
-
via david
可能是不错的中文文档
-
-
blog.golang.org blog.golang.org
-
worth reading
-
-
github.com github.com
-
Adding an API for something is an endorsement of that approach.
-
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.
-
-
news.ycombinator.com news.ycombinator.com
-
seems a good article/paper explaining zk-Snark
-
-
-
might be useful for Kalm Resource Quota
Tags
Annotators
URL
-
-
github.com github.com
-
via david, OAM
-
-
github.com github.com
-
via david, mentioned by OAM guys in Ali
-
-
formvalidation.io formvalidation.io
-
formvalidation: path.resolve
Why use resolve.alias to point to 'vendors/formvalidation/dist/es6'? Why not just use an npm package and have package.json name module: 'vendors/formvalidation/dist/es6'
Then (I think) the examples below like
import luhn from 'formvalidation/algorithms/luhn';
would work the same but without that workaround.
-
-
humanwhocodes.com humanwhocodes.com
-
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.
-
-
-
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.
-
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 more concise because it's just a function call and doesn't require a closing tag. Using it will greatly simplify your tooling chain.
I suppose this is also an argument that Python tries to make? That other languages have this con:
- cons: closing tags make it more verbose / increase duplication
and that Python is simpler / more concise because it uses indentation instead of closing delimiters like
end
or}
?
- cons: closing tags make it more verbose / increase duplication
and that Python is simpler / more concise because it uses indentation instead of closing delimiters like
-
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.
-
I wasn't aware react-hyperscript existed!
-
@subfuzion That error looks unrelated to the existing discussion.
I assume they locked it in reaction to someone posting something unrelated / off-topic.
-
This is the problem with baking in support for frameworks with special cases in the codebase. You can never support all the frameworks. :-(
Tags
- reuse existing language constructs
- most people don't know about it
- paving cow paths
- Python
- not merited
- concise
- is it worth the effort?
- can't support everything / all cases
- UI library
- XML/HTML
- template language vs. reusing existing language constructs
- ruined it for the rest of us
- special cases
- it's just _
- copy and paste
- javascript
- copy and paste programming
- favoring/catering to the needs of … over …
- doing something without knowing why/how it works
- hyperscript
- JavaScript
- adding special cases only for certain popular things but not others
- duplication
- it's just plain JavaScript
- making it easy to do the right thing
- cons: closing tags make it more verbose / increase duplication
- toolchain
- do pros outweigh/cover cons?
- simplify
- bad engineering
- making it easy for later refactoring
- cargo cult
- hard to make it work in _all_ cases
- minimal benefits
- have a good reason
- extensibility
- JSX
- familiarity
- making it easy to do the wrong thing
- advantages/merits/pros
- plugins
- path of least resistance
- due to historical reasons
- can't do everything
- not enough advantages/merits/pros to make it worthwhile
- encourages the wrong thing
- hypothetical/alternate history
- HTMLx
- locked discussion threads
- difficult/hard
- template language: bad: by not reusing existing language constructs; forced to reinvent equivalents which are inferior and unfamiliar
- comparison with:
- making it too easy to do the wrong thing
- off topic
- UI library: syntax
- familiar syntax
Annotators
URL
-
-
github.com github.com
-
However, in function components there really isn't much need for this pattern since you can just use JS default arguments
-
This is a very unusual pattern and most people don't know you can.
-
-
www.npmjs.com www.npmjs.comhyperx1
-
http://facebook.github.io/jsx/#why-not-template-literals (respectfully disagree)
-
-
www.python.org www.python.org
-
code is read much more often than it is written.
-
-
birthday.play-with-docker.com birthday.play-with-docker.com
-
docker interactive course, seems interesting
Tags
Annotators
URL
-
-
www.baeldung.com www.baeldung.com
-
With or Without ‘export’
shell, With or Without ‘export’
Tags
Annotators
URL
-
-
medium.com medium.com
-
But the vast majority of things that our apps are doing are just conditional and list rendering.
-
Svelte chooses a reverse approach.
-
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
Tags
- it is enough to be basic (don't need all the bells and whistles)
- good/preferred/recommended behavior
- not good enough reason/rationale/explanation
- different approaches
- intentionally doing it differently / _not_ emulating/copying the way someone else did it
- rationality
- time wasters
- contrast
- not adding feature because of the risk it may be abused / shoot self in foot
Annotators
URL
-
-
en.wikipedia.org en.wikipedia.org
-
Alfred Korzybski remarked that "the map is not the territory" and that "the word is not the thing", encapsulating his view that an abstraction derived from something, or a reaction to it, is not the thing itself.
-
The map–territory relation describes the relationship between an object and a representation of that object, as in the relation between a geographical territory and a map of it.
-
-
github.com github.com
-
When using TypeScript, cast the type of file.contents on your side.
-
-
www.coursera.org www.coursera.org
-
The default groups, that we talked about before, like domain users and domain admins are security groups. They're used to grant or deny access to IT resources.
-
A distribution group, is only designed to group accounts and contacts for email communication. You can't use distribution groups for assigning permission to resources.
-
-
www.coursera.org www.coursera.org
-
The service that hosts copies of the Active Directory database are called domain controllers, or DCs
Hosts a replica of the Active Directory database and group policy objects.
Serve as DNS servers to provide name resolution and service discovery to clients.
Provides central authentication through a network security protocol called Kerberos
Decides whether or not clients have access to shared resources like file systems and printers
-
Active Directory has been used to centrally manage networks of computers
- A native service for Microsoft Windows
- Knows how to speak LDAP protocol and can interoperate with Linux, OS-X and other non-windows hosts
- Central repository of Group Policy Objects (GPOs)
-
One of the most common methods for this authentication is using Kerberos.
- Kerberos is a network authentication protocol that is used to authenticate user identity, secure the transfer of user credentials, and more
-
role-based access control, or RBAC
Is an approach to restricting system access to authorized users.
Controlling access to resources isn't all you can do. You can also centralize configuration management.
You wouldn't want to setup printers or software for each and every user.
-
-
dylanvann.com dylanvann.com
-
A component shouldn’t break because it’s rendered more or less often.
-
Keep the local state isolated.Think about which state is local to a particular UI representation — and don’t hoist that state higher than necessary.
-
Even if a component is rendered just once, your design will improve if rendering twice doesn’t break it.
-
-
github.com github.com
-
I'm suggesting there should be a way to write lifecycle related code that also responds to changing props, like how useEffect works. I think how React handles this could be a good source of inspiration.
-
While react hooks were one of the catalysts for v3 we don't agree with with the APIs or the model and won't be emulating it.
Tags
- can we do even better?
- official opinion/stance/position
- Dylan Vann
- learning from others
- inspiration
- Svelte
- react hooks
- use as inspiration
- intentionally doing it differently / _not_ emulating/copying the way someone else did it
- excellent writing
- intentional/well-considered decisions
- copying ideas from another project
- copying/doing the same as how another project/library did it
- learning by studying/emulating/copying others who do it well
- feature proposal
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.
-
-
dylanvann.com dylanvann.com
-
Disclaimer: I’m new to Svelte so this isn’t so much a recommendation as it is a “I guess this is a way to do it 🤷♂️”
-
-
helm.sh helm.sh
-
more about helm, and how to create a helm chart
Tags
Annotators
URL
-
-
eriktorenberg.substack.com eriktorenberg.substack.com
-
via ruanyifeng http://www.ruanyifeng.com/blog/2020/09/weekly-issue-127.html
漫画家斯科特·亚当斯(Scott Adams)曾经提过一种建立个人护城河的方法,就是找到自己最擅长的2个~3个事物的交集。比如,他既不是最好的漫画家,也不是最好的作家,也不是最好的企业家,但他可以是最好的商业类漫画短文作者,这就是他的护城河。
-
-
-
I actually wasn't trying to promote this like I usually promote my articles.
-
I wasn't really intending this article to get spread as far as it did without context. I never tagged it, I didn't make it a general post on Social media or on Hacker News
-
you expect some hyperbole during these presentations and you should of course question and verify the claims being made.
-
helped me carve a niche for what would become SolidJS. I still see that space today, so I'm glad that I did.
-
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.
-
but everything they were doing started to make sense
-
This was the piece that made all their other recent work all gel and I gazed into the sun for the beauty that was there.
-
I started Solid years ago before I thought anyone would be interested in using it. I only started promoting it because it had already achieved the goals I had set out for it.
Tags
- confident claims
- finally got it right
- beauty
- needs to feel right
- work on it until happy with the results/how it works/looks/feels
- sharing/publishing what started as a personal project; so others can use it/benefit too
- feels natural
- constant evolution/improvement of software/practices/solutions
- finally / at last
- only as good/strong/etc. as weakest link
- getting/attaining wide reach/audience/popularity without even trying/promoting it (accidentally)
- hyperbole
- don't take my word for it; try/test/verify it yourself
- there is a need/niche for it
- build the product you want to use yourself
- better/superior solution/way to do something
- they're glad they did
Annotators
URL
-
-
github.com github.com
-
JSX is an XML-like syntax extension to EcmaScript (https://facebook.github.io/jsx/). It is not a language or runtime.
-
-
-
Templates are prone to unnoticed runtime errors, are hard to test, and are not easy to restructure or decompose.
-
-
en.wikipedia.org en.wikipedia.org
-
React does not attempt to provide a complete "application library". It is designed specifically for building user interfaces[3] and therefore does not include many of the tools some developers might consider necessary to build an application.
-
-
codesandbox.io codesandbox.io
-
Is that expected behavior or am I doing something wrong?
-
-
-
(Note sure if this is a feature request or a bug...)
-
-
final-form.org final-form.org
-
both copied much of their API from Redux Form, so, despite working very differently under the hood, there is a lot of overlap in their APIs.
-
-
www.youtube.com www.youtube.com
-
a more in-depth dive into Envoy from the Author
-
-
softwarerecs.stackexchange.com softwarerecs.stackexchange.com
-
I'm glad they added this site. Instead of just closing such questions as "off topic" on StackOverflow or SuperUser without having them some place appropriate to send them.
-
-
github.com github.com
-
However, IMO, having the conditional in the detach function is necessary, because there are other manifestations of this error. For example, if the DOM element in a component is removed from software outside of svelte, detach will have the same error.
-
IMO, the conditional needs to be added to detach to fix all manifestations of this error.
-
- 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
-
-
stackoverflow.com stackoverflow.com
-
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.
-
-
github.com github.com
-
export let client; setContext("client", client);
Wouldn't this set context to undefined initially? And reassigning a new value to client wouldn't update the value stored in the context, would it? It would only update the
let client
variable.Where does this let client actually get set to the client from
async function preload
? I guess I need to understand Sapper more to know how this works, but it doesn't seem like it could.Update: I think I found the answer (it runs before):
https://hyp.is/3aHeJgNFEeunkCsh8FVbDQ/sapper.svelte.dev/docs/
It lives in a
context="module"
script — see the tutorial — because it's not part of the component instance itself; instead, it runs before the component is created, allowing you to avoid flashes while data is fetched.
-
-
devblogs.microsoft.com devblogs.microsoft.com
-
This is so common that ECMAScript 2020 recently added a new syntax to support this pattern!export * as utilities from "./utilities.js";This is a nice quality-of-life improvement to JavaScript, and TypeScript 3.8 implements this syntax. When your module target is earlier than es2020, TypeScript will output something along the lines of the first code snippet.
-
If you’ve used Flow before, the syntax is fairly similar. One difference is that we’ve added a few restrictions to avoid code that might appear ambiguous.
-
-
medium.com medium.com
-
Rollup also does something very different compared to the other bundlers. It only tries to achieve one simple goal: Bundle ES modules together and optimise the bundle.
-
-
engineering.mixmax.com engineering.mixmax.com
-
But this is only a halfway decent way to clarify that this is an external dependency, because the only way to resolve a peer dependency warning is to install react from npm—there's no way to notify npm that you resolve the dependency to a browser global. So peer dependencies should be avoided in favor of external declarations. Then Rollup will take care of warning about "unresolved dependencies", even if external declarations can't express a particular version range with which your library is compatible like peer dependencies can.
Interesting. Didn't realize. From my perspective, I usually do install packages via npm, so wouldn't have known about this problem.
npm and rollup both try to solve this problem but in different ways that apparently conflict? So if a lib author lists peerDependencies then it can cause problems for those getting lib via browser (CDN)? How come so many libs use it then? How come I've never heard of this problem before?
-
-
github.com github.com
-
Then, the projects that use these libraries get to process these import statements how they like when they are bundled. For the ones that wish to load jQuery from a global, we again mark 'jquery' as an external—since we still don't want Rollup to bundle jQuery—and as a global.
-
-
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.
-
-
www.wired.com www.wired.com
-
Basically, the idea is that a train tried to start with the caboose brakes stuck on. After releasing the caboose, the train still could not start. The problem was that when the train attempted to start with the caboose brake on, it stretched all the inter-car couplings so that the whole train was just like one big car. At this point, the friction from the engine train wheels was not enough to get the whole thing going. Instead, you need to just get one car moving at a time - this is why there is space between the couplings.
-
-
codingwithspike.wordpress.com codingwithspike.wordpress.com
-
Even without the dedupe, you waste some drive space, but the code at least works and can resolve its dependencies!
-
-
medium.com medium.com
-
possibly making it harder for them to appreciate how severe the discoverability issues are for the rest of us.
-
-
github.com github.com
-
DX: start sapper project; configure eslint; eslint say that svelt should be dep; update package.json; build fails with crypt error; try to figure what the hell; google it; come here (if you have luck); revert package.json; add ignore error to eslint; Maybe we should offer better solution for this.
-
When the message say function was called outside component initialization first will look at my code and last at my configuration.
Tags
- can we do even better?
- errors
- errors are helpful for development (better than silently failing)
- frustrating
- web search for something brings me here
- error messages: should reveal/point to why/how error was caused and how to fix/prevent it
- dev experience
- what a reasonable person would do
- good point
- useless/unhelpful/generic error messages that don't reveal why/how error was caused
- reasonable expectation
- expectations
Annotators
URL
-
-
github.com github.com
-
For context, the previous API had a lazy promise. Currently I’m thinking we could just return a closure like in the React API
-
-
stackoverflow.com stackoverflow.com
-
This is the same as useEffect in React, incidentally — the function must be synchronous in order to avoid race conditions.
-
(Note that you're responsible for handling any race conditions that arise as a result of the component being destroyed before the promise resolves, though assigning state inside a destroyed component is harmless.)
-
-
github.com github.com
-
This isn't really a bug, because if you have an async function that returns a function, it doesn't really return a function - it returns a promise. I don't remember whether the Svelte internals currently check for the onMount callback's return being a function or whether they check for it being truthy. Maybe there's some adjustment to be made there.
-
-
-
Also Svelte is so great because developer do not need to worry about class names conflict, except of passing (global) classes to component (sic!).
-
-
-
There are work arounds, but nothing clean. I just feel like this should be functionality that should be part of the slot feature.
-
-
github.com github.com
-
Svelte will not offer a generic way to support style customizing via contextual class overrides (as we'd do it in plain HTML). Instead we'll invent something new that is entirely different. If a child component is provided and does not anticipate some contextual usage scenario (style wise) you'd need to copy it or hack around that via :global hacks.
-
The main rationale for this PR is that, in my hones opinion, Svelte needs a way to support style overrides in an intuitive and close to plain HTML/CSS way. What I regard as intuitive is: Looking at how customizing of styles is being done when applying a typical CSS component framework, and making that possible with Svelte.
-
Explicit interfaces are preferable, even if it places greater demand on library authors to design both their components and their style interfaces with these things in mind.
-
The RFC is more appropriate because it does not allow a parent to abritrarily control anything below it, that responsibility still relies on the component itself. Just because people have been passing classes round and overriding child styles for years doesn't mean it is a good choice and isn't something we wnat to encourage.
-
margin, flex, position, left, right, top, bottom, width, height, align-self, justify-self among other is CSS properties that should never be modified by the child itself. The parent should always have control of those properties, which is the whole reason I'm asking for this.
-
new style RFC
Tags
- maintenance burden to explicitly define/enumerate/hard-code possible options (explicit interface)
- run-time dynamicness/generics vs. having to explicitly list/hard-code all options ahead of time
- missed opportunity: link to what you are referring to
- forking to add a desired missing feature/change
- constraints are helpful
- component/library author can't consider/know ahead of time all of the ways users may want to use it
- intuitive
- burden
- which component/tool/organization/etc. is responsible for this concern?
- make it a link if can be made a link to something useful/relevant
- principle of least surprise
- Svelte: components are their own boss (encapsulation)
- maintenance burden
- who should have control over this? (programming)
- customizable
- copying/doing the same as how another project/library did it
- Svelte: how to affect child component styles
- whose responsibility is it?
- workarounds
- limiting how much library consumers/users can control/override
- being explicit
- forced to fork/copy and paste library code because it didn't provide enough customizability/extensibility / didn't foresee some specific prop/behavior that needed to be overridable/configurable (explicit interface)
- reinventing the wheel / not invented here
- missed opportunity
- trying to prevent one bad thing leading to people doing/choosing an even worse option
- control (programming)
- programming: who is responsible for this concern?
- ugly/kludgey
- explicit interfaces
Annotators
URL
-
-
github.com github.com
-
This has already forced me to forgo Svelte Material because I would like to add some actions to their components but I cannot and it does not make sense for them to cater to my specific use-case by baking random stuff into the library used by everyone.
-
The point of the feature is to not rely on the third-party author of the child component to add a prop for every action under the sun. Rather, they could just mark a recipient for actions on the component (assuming there is a viable target element), and then consumers of the library could extend the component using whatever actions they desire.
Tags
- reusability
- run-time dynamicness/generics vs. having to explicitly list/hard-code all options ahead of time
- flexibility
- pass-through arguments/props/options
- component/library author can't consider/know ahead of time all of the ways users may want to use it
- why this feature is needed
- extensibility
- Svelte: action (use:)
Annotators
URL
-
-
github.com github.com
-
Does it look like a decorator plugin in Ractive, right
-
Lets not extend the framework with yet another syntax
-
Your LazyLoad image is now inextensible. What if you want to add a class? Perhaps the author of LazyLoad thought of that and sets className onto the <img>. But will the author consider everything? Perhaps if we get {...state} attributes.
-
I totally get not wanting to extend the syntax. I tried doing these things and in practice it was not easy or pretty. Actions provide a much cleaner and easier way to accomplish a certain set of functionality that would be much more difficult without it.
Tags
- run-time dynamicness/generics vs. having to explicitly list/hard-code all options ahead of time
- clean
- analogue
- clean solution
- component/library author can't consider/know ahead of time all of the ways users may want to use it
- could be easier / more difficult than it needs to be
- decorator
- comparison
- extensibility
- just use/do...
- copying/doing the same as how another project/library did it
- inextensible
- programming: multiple ways to do the same thing
- plugins
- feature not needed; better to use a different approach/feature instead
- you aren't going to need it
- library/framework could make this easier
- avoid complexity
- keep things simple
Annotators
URL
-
-
-
And to illustrate another way actions are helpful, take your above example and put the button into a {{#each}}. It gets more complicated.
-
I'm just pushing on the "is this really a good idea" front
-
If this was tied into Svelte's flow with hooks this would not be necessary since it would know when it was being removed from the DOM.
-
Another problem I ran into was knowing when an element is removed. I had to add a MutationObserver on the current tooltip target so if it gets removed by Svelte while the tooltip is visible (e.g. if a click moves to another route) the tooltip isn't left hanging around on the screen. No mouseleave/mouseout events are dispatched on elements that are removed.
First sighting: MutationObserver
-
You must: reference each element you are extending using refs or an id add code in your oncreate and ondestroy for each element you are extending, which could become quite a lot if you have a lot of elements needing extension (anchors, form inputs, etc.)
-
This is where hooks/behaviors are a good idea. They clean up your component code a lot. Also, it helps a ton since you don't get create/destroy events for elements that are inside {{#if}} and {{#each}}. That could become very burdensome to try and add/remove functionality with elements as they are added/removed within a component.
-
I would be willing to take a stab at it if you think it would be a task within reach.
Tags
- edge cases
- feature not needed; better to use a different approach/feature instead
- too hard/difficult/much work to expect end-developers to write from scratch (need library to do it for them)
- contributing: willing to attempt/try to implement it
- first sighting
- Web APIs
- harder than it seems / than you would expect
- framework taking care of responsibility so users can leverage it and not have to worry about that responsibility themselves
- difficult/hard
- you aren't going to need it
- library/framework could make this easier
- could be easier / more difficult than it needs to be
- scalability
- why this feature is needed
- from different perspective/point of view
Annotators
URL
-
-
-
But some sort of official way to do that in the language would make this nicer - and would mean I would have to worry less about destroying components when their parent is destroyed, which I'm certainly not being vigilant about in my code.
-
-
github.com github.com
-
Re Object.keys(undefined), I think I'm ok with that failing. AFAIK it would also fail in React
-
The more I think about this, the more I think that maybe React already has the right solution to this particular issue, and we're tying ourselves in knots trying to avoid unnecessary re-rendering. Basically, this JSX... <Foo {...a} b={1} {...c} d={2}/> ...translates to this JS: React.createElement(Foo, _extends({}, a, { b: 1 }, c, { d: 2 })); If we did the same thing (i.e. bail out of the optimisation allowed by knowing the attribute names ahead of time), our lives would get a lot simpler, and the performance characteristics would be pretty similar in all but somewhat contrived scenarios, I think. (It'll still be faster than React, anyway!)
-
-
github.com github.com
-
I think we could even broadly caveat that by saying “do whatever element you want” but don't expect Svelte to care about following any HTML spec, etc.
-
-
github.com github.com
-
The feature is highly likely to be implemented, the API and implementation are the only real topics of discussion right now.
-
-
blog.logrocket.com blog.logrocket.com
-
Yup, which was released six years ago, is obviously a more popular choice at this time. Zod is smaller in size, probably because it doesn’t have as many APIs as Yup, but it’s sure to grow as more features are developed.
-
-
github.com github.com
-
When a component reaches such a size that this becomes a problem, the obvious course of action is to refactor it into multiple components. But the refactoring is complex for the same reason: extracting the styles that relate to a particular piece of markup is an error-prone manual process, where the relevant styles may be interleaved with irrelevant ones.
-
-
github.com github.com
-
(At the point at which it does make sense to turn this into a separate Tooltip.svelte component, the extraction is a completely mechanical process that could even be automated by tooling.)
-
-
jsrocks.org jsrocks.orgJS Rocks1
-
6to5 attempted to ship a quick and dirty TDZ static checking feature but had to retract it immediately afterwards due to various bugs in the algorithm.
-
-
github.com github.com
-
You can help ensure your RFC is reviewed in a timely manner by putting in the time to think through the various details discussed in the template. It doesn't scale to push the thinking onto a small number of core contributors.
-
-
github.com github.com
-
There are tools in Svelte that break this expectation to a degree, but they are a bit annoying to use, which makes it an active decision on the part of the developer. The API hints at the way we want you to do things because we feel that this will give the better experience.
-