https://annotations.lindylearn.io/
What a great UI for annotations on Hypothes.is and Hacker News.
I wonder if this is pulling data from the public Hypothesis API? What triggers inclusion into the lists?
https://annotations.lindylearn.io/
What a great UI for annotations on Hypothes.is and Hacker News.
I wonder if this is pulling data from the public Hypothesis API? What triggers inclusion into the lists?
The Annotations API is an extension to the Europeana REST API which allows you to create, retrieve and manage annotations on Europeana objects. Annotations are user-contributed or system-generated enhancements, additions or corrections to (or a selection of) metadata or media. We adopted the Web Annotation Data Model as a base model for the representation of annotations and as a format for exchanging annotations between client applications and the API, but also the Web Annotation Protocol as base HTTP protocol for the API.
Example:
{
"@context": “http://www.w3.org/ns/anno.jsonld”
"id": "http://data.europeana.eu/annotations/1",
"type": "Annotation",
"created": "2015-03-10T14:08:07Z",
"creator": {
"type": "Person",
"name": "John Smith"
},
"generated": "2015-04-01T09:00:00Z",
"generator": {
"type": "Software",
"name": "HistoryPin",
"homepage": "https://www.historypin.org/"
},
"motivation": "tagging",
"bodyValue": "MyBeautifulTag",
"target": "http://data.europeana.eu/item/92062/BibliographicResource_1000126189360"
}
Sit in your local coffee shop, and your laptop can tell you a lot. If you want deeper, more local knowledge, you will have to take the narrower path that leads between the lions and up the stairs.
Grafton cleverly brings us back to his beginning with the New York Library, whose entrance famously has a set of stairs flanked by two majestic lions.
The databases include multiple copies of some titles. But they will never provide all the copies of, say, “The Wealth of Nations” and the early responses it provoked.
The exact same could be said of the early web which hasn't been evenly archived or easily searchable, so responses to early blog articles may not be easily found amidst a mountain of noise.
how to create, access, make available, re-use, adapt, and redistribute OER
As presented at OERcamp 2021:
The three-year IMLS Grant, Reaching Out: Meeting the Needs of Rural School Librarians, focused on building capacity of stakeholders to create, access, use, adapt and redistribute OER. Grant participants learned the skills needed to utilize Open Educational Resources (OER), to integrate digital applications into professional practices, and to serve as instructional leaders in their schools.
See presentation resources https://tie.link/oercamp
libraries
The Open Education in European Libraries of Higher Education (2021) provides a comprehensive summary of how European libraries are implementing the UNESCO Recommendation of OER. "The research analysed responses from 233 libraries from 28 European countries. Respondents primarily came from universities, followed by technical colleges, specialised institutions, universities of applied sciences, teaching colleges, distance education institutions and other service centres."
The SPARC Europe survey shows familiarity with the UNESCO OER Recommendation amongst many academic libraries, with about one-third of respondents taking concerted action. Therefore, whilst some concretely address the UNESCO OER Recommendation, further awareness-raising and support in academic libraries and their institutions is required to help implement it.
Of all of the five actions of the UNESCO Recommendation on OER, building the capacity of stakeholders to create, access, re-use, adapt and redistribute OER, developing supportive policy for OER, encouraging inclusive and equitable quality OER, nurturing the creation of sustainability models for OER, and promoting and reinforcing international cooperation in OER, libraries are carrying out capacity-building activities the most. Libraries continue to lead or support OE in equal measure and lead in areas close to their core work. They do this mainly through their teaching and learning and research support departments. In addition, they work in conjunction with Open Access and Open Science areas when advocating for open.
Deeply importing Svelte components is not supported. Either import all components from one entrypoint, or always stick to deep imports, otherwise it could cause multiple instance of the Svelte library running.
A good library is filled with mostly unread books. That’s the point. Our relationship with the unknown causes the very problem Taleb is famous for contextualizing: the black swan. Because we underestimate the value of what we don’t know and overvalue what we do know, we fundamentally misunderstand the likelihood of surprises. The antidote to this overconfidence boils down to our relationship with knowledge. The anti-scholar, as Taleb refers to it, is “someone who focuses on the unread books, and makes an attempt not to treat his knowledge as a treasure, or even a possession, or even a self-esteem enhancement device — a skeptical empiricist.” My library serves as a visual reminder of what I don’t know.
I prefer the positive interpretation, of how much more there is to know. Quantifying anything in terms of how much we do not have is limited because we have finite knowledge out of an infinite set.
Each book instead of referencing something we do not know is a portal into things we have yet to know.
I think Nassim Taleb also mentioned elsewhere that having a lot of books you haven't read shows interest in a topic.
Its good to know how to implement it. I would prefer to use a gem myself.
copyright and open licensing of educational material
A very excellent example of this in action is the Copyright First Responders Pacific Northwest that creates a network and directory of librarians who "have received training and, crucially, support one another in providing basic front-line triage for copyright questions in their home libraries and, in many cases, beyond." Sort of like 911 for copyright?
The program is modeled after the program created at Harvard... one can wonder what if this was scaled or spread more widely?
https://torrentfreak.com/book-publishers-expand-uk-pirate-site-blocking-151128/
Blocking at the ISP level has been used as a strategy for preventing copyright for a while. What better methods might exist? Is this method just whack-a-mole?
The usual targets of The Publishers Association include domains that facilitate access to the popular Libgen library and eBook portals eBookee and FreeBookSpot. The trend was maintained this week when ISP TalkTalk revealed that more domains had been blocked in the UK. The new additions are as follows: ebookee.unblockit.kim, ebookee.123unblock.world, ebookee.mrunblock.bar, ebookee.nocensor.biz, ebookee.unbl4you.cyou, ebookee.unbl0ck.icu, ebookee.unblockproject.top, ebookee.proxybit.sbs, freebookspot.unblockit.kim, libgen.unblockit.kim, libgen.123unblock.world, libgen.mrunblock.bar, libgen.nocensor.biz, libgen.unbl4you.cyou,, libgen.unbl0ck.icu, libgen.unblockproject.top, libgen.proxybit.sbs
you can define locally parse and it should take precedence over the one in the library: interface JSON { parse(text: string, reviver?: (key: any, value: any) => any): unknown; }
we establish Saturated Programmable Insertion Engineering (SPINE), an unbiased, comprehensive, and targeted domain insertion library generation technique using oligo library synthesis and multi-step Golden Gate cloning
<small><cite class='h-cite via'>ᔥ <span class='p-author h-card'>Peter Hagen</span> in Peter Hagen (@peterhagen_) / Twitter (<time class='dt-published'>10/25/2021 09:47:19</time>)</cite></small>
Yesterday, I found some books in the stacks at the University of the Fraser Valley Library to research the evolution of design from physical artifacts to living systems.
If you fail to changes this, you may experience performance issues, and other bugs related to multiple copies of React, like issue 2932.
In the vast majority of cases when I'm using prettier-ignore I'm only really looking to prevent it from breaking my code into new lines, whilst keeping its other transformations such as switching quotes and adding space between brackets. When ignoring single lines, fixing these formatting problems by hand is very manageable. With the ability to have Prettier ignore entire blocks of code I think the ability to specify what you want it to ignore is essential.
This should be basic functionality.
I have a rule that I won't allow Capybara to be monkey-patched in Poltergeist. This gives some indication to users about whether something is non-standard. So basically all non-standard stuff must be on page.driver rather than page (or a node).
I think that it's nonsense not to have a method that just gives -1 or +1. Even BASIC has such a function SGN(n). Why should we have to deal with Strings when it's numbers we want to work with. But's that's just MHO.
As Jorge Luis Borges pointed out, a library without an index becomes paradoxically less informative as it grows.
Explore why this is so from an information theoretic perspective. Is it true?
Watching the corpse flower bloom at the Huntington for a minute or two.
Gottfried Wilhelm Leibniz (1646-1716), der nicht nur angesehener Mathematiker und Philosoph war, sondern auch Bibliothekar der Herzog August Bibliothek in Wolfenbüttel, soll sich eigens einen Karteischrank als Büchermöbel nach eigenen Vorstellungen haben bauen lassen.
Gottfried Wilhelm Leibniz (1646-1716), who was not only a respected mathematician and philosopher, but also librarian at the Herzog August Library in Wolfenbüttel, is said to have had a filing cabinet built for him as book furniture according to his own ideas.
I'm curious to hear more about what this custom library furniture looked like? Could it have been the precursor to the modern-day filing cabinet?
I can picture something like the recent photo I saw of Bob Hope amidst his commonplace book.
The Joke File has been scanned into an internal database that is accessible on-site in both the Recorded Sound and Moving Image Research Centers.
Bob Hope's commonplace book of jokes has been scanned digitally and available at the United States Library of Congress.
But if you're working on a bigger project, with multiple packages and a complex dependency tree, you might want to combine npm with a tool like Lerna.
Some interesting resources for music, audio, and video from the Library of Congress mentioned at IAnno21.
Twitter account for the Digital Strategy group of the Library of Congress.
AnyCable uses the same protocol as ActionCable, so you can use its JavaScript client without any monkey-patching.
This is why for a recent Angular+Rails project we chose to use a testing stack from the backend technology’s ecosystem for e2e testing.
We used testing tools that were in the same ecosystem as our backend technology stack for primrily three reasons: We owned both ends of the stack Team experience Interacting with the database
We chose to define the frontend in one technology stack (Angular+TypeScript/JavaScript) and the backend in another (Ruby+Ruby on Rails), but both came together to fulfill a singular product vision.
Note: as for setting boolean variables: not only are true/false and 0/1 acceptable values, but also T/F and on/off. Thanks, coercible!
Do not test the internal implementation of the child components:
Don’t test the library
Testing the hasMetricTypes computed prop would seem like a given here. But to test if the computed property is returning the length of metricTypes, is testing the Vue library itself. There is no value in this, besides it adding to the test suite.
Or if you're looking for a core extension that adds this to the Array class, I'd recommend the facets gem (require 'facets/array/average'). Then you can just do array.average. And, from looking at the source, it turns out they do the exact same thing as the instance_eval approach above. The only difference is that it's implemented as a method—which of course already has self pointing to itself—instead of a block): def average; return nil if empty?; reduce(:+) / length.to_f; end Main advantage of this is that it's even more concise/readable and it handles the empty? case.
The great library of Alexandria, which began around 300 B.C.E., created a cataloguing system called Pinakes to manage the estimated 500,000 books in the collection of the Ptolemaic pharaohs. The Pinakes were sophisticated bibliographical lists containing title, incipit (the first few lines of each text), the number of lines for each work, and a subject and author index.
Pinakes!
In fact, I'm only here because it seems like something one would 'expect' ruby already to do.
but I like that Svelte comes with a good CSS story out the box.
comes with a good CSS story out the box
Svelte is different in that by default most of your code is only going to run once; a console.log('foo') line in a component will only run when that component is first rendered.
I ended up renting an ebook version for more money than I should have had to pay to buy the thing, which is my darn fault because I wanted quick access
McCabe, Stefan, Leo Torres, Timothy LaRock, Syed Arefinul Haque, Chia-Hung Yang, Harrison Hartle, and Brennan Klein. ‘Netrd: A Library for Network Reconstruction and Graph Distances’. ArXiv:2010.16019 [Physics], 29 October 2020. http://arxiv.org/abs/2010.16019.
The Law of Innocence
This is a test annotation made public
No. 6 collaborations project [sound recording]
This is a test annotation made public
he goes on to talk about third party problems and how you're never guaranteed something is written correctly or that even if it is you don't know if it's the most optimal solution
this only applies to end products which are actually deployed. For my modules, I try to keep dependency version ranges at defaults, and recommend others do the same. All this pinning and packing is really the responsibility of the last user in the chain, and from experience, you will make their life significantly more difficult if you pin your own module dependencies.
The question, 'What is library and information science?' does not elicit responses of the same internal conceptual coherence as similar inquiries as to the nature of other fields, e.g., 'What is chemistry?', 'What is economics?', 'What is medicine?' Each of those fields, though broad in scope, has clear ties to basic concerns of their field. [...] Neither LIS theory nor practice is perceived to be monolithic nor unified by a common literature or set of professional skills. Occasionally, LIS scholars (many of whom do not self-identify as members of an interreading LIS community, or prefer names other than LIS), attempt, but are unable, to find core concepts in common
Some believe that computing and internetworking concepts and skills underlie virtually every important aspect of LIS, indeed see LIS as a sub-field of computer science!
This allows those other dependencies to share the same module instance.
URI::MailTo::EMAIL_REGEXP
First time I've seen someone create a validator by simply matching against URI::MailTo::EMAIL_REGEXP from std lib. More often you see people copying and pasting some really long regex that they don't understand and is probably not loose enough. It's much better, though, to simply reuse a standard one from a library — by reference, rather than copying and pasting!!
While you could nest an activity into another manually, the Subprocess macro will come in handy.
The macro automatically wires all of Validate’s ends to the known counter-part tracks.
Have you ever felt like a framework was getting in the way instead of helping you go faster? Maybe you’re stuck on some simple task that would be easy to do manually, but your framework is making you jump through configuration hoops. I end up getting lost in a sea of documentation (or no documentation), and the search for that one magical config key takes just a tad bit too long. It’s a productivity sink, and worse than the time delay it adds to my frustration throughout the day.
Trailblazer is an architectural pattern that comes with Ruby libraries to implement that pattern.
ActiveModel provides a powerful framework for defining callbacks. ActiveInteraction hooks into that framework to allow hooking into various parts of an interaction's lifecycle.
For this one we'll define a helper method to handle raising the correct errors. We have to do this because calling .run! would raise an ActiveInteraction::InvalidInteractionError instead of an ActiveRecord::RecordNotFound. That means Rails would render a 500 instead of a 404.
True, but why couldn't it handle this for us?
No one has requested it before so it's certainly not something we're planning to add.
To give a little more context, structures like this often come up in my work when dealing with NoSQL datastores, especially ones that rely heavily on JSON, like Firebase, where a records unique ID isn't part of the record itself, just a key that points to it. I think most Ruby/Rails projects tend towards use cases where these sort of datastores aren't appropriate/necessary, so it makes sense that this wouldn't come up as quickly as other structures.
Writing the uniqueness validations yourself is easy so I felt it was better to leave this up to the developer
The "authority terms" comprising it are expected to be used outside the library catalog, as metadata in the sources, enabling links to the taxonomy.
Now if you think about it, PJAX sounds a lot like Turbolinks. They both use JS to fetch server-rendered HTML and put it into the DOM. They both do caching and manage the forward and back buttons. It's almost as if the Rails team took a technique developed elsewhere and just rebranded it.
Increasing student motivation and the perception of chemistry's relevance in the classroom by learning about tattooing from a chemical and societal view
for later
From Cookbook to Research: Redesigning an Advanced Biochemistry Laboratory
for later
Chemistry outreach as a community of practice: investigating the relationship between student-facilitators’ experiences and boundary processes in a student-run organization
read later
The relationship between subject matter knowledge and teaching effectiveness of undergraduate chemistry peer facilitators
peer instruction and facilitation
If components gain the slot attribute, then it would be possible to implement the proposed behavior of <svelte:fragment /> by creating a component that has a default slot with out any wrappers. However, I think it's still a good idea to add <svelte:fragment /> so everyone who encounters this common use case doesn't have to come up with their own slightly different solutions.
Popper for Svelte with actions, no wrapper components or component bindings required! Other Popper libraries for Svelte (including the official @popperjs/svelte library) use a wrapper component that takes the required DOM elements as props. Not only does this require multiple bind:this, you also have to pollute your script tag with multiple DOM references. We can do better with Svelte actions!
Biosciences Robert Sabin 713-348-4324 Charles Stewart
library contact person
If you'd prefer, you can use a third-party library like Modernizr or Detect It to do this test for you.
Sometimes, systems just scale the problemA UI design system is more than the code of a component library. It’s more than the colors, styles, and margins of your elements. It’s an ever-growing and ever-evolving creature that entails your brand and your user’s feelings.
If you don't understand the problem - you can [[scale the problem instead of solve the problem]], and it's important to remember that a [[design system is more than a component library]]
I also find that a lot of the complexity of Flutter can be avoided, and I mostly use it to define the UI as a more app-centric alternative to HTML/CSS.
I mostly use it to define the UI as a more app-centric alternative to HTML/CSS.
As was mentioned in the comments above, the material design spec for buttons specifies that the text should be uppercase, but you can easily override its CSS property: paper-button { text-transform: none; }
@use "@material/theme" with ( $primary: #FEDBD0, $on-primary: #442C2E);
The ultimate goal of the Open Library is to make all the published works of humankind available to everyone in the world. While large in scope and ambition, this goal is within our grasp.
This module should not be used in other npm modules since it modifies the default require behavior! It is designed to be used for development of final projects i.e. web-sites, applications etc.
Is there any service that does this sort of alert when my library gets a book I want?
Not quite the functionality you're looking for, but in the same sort of vein as WorldCat:
Library Extension is a browser extension that works on Amazon, Goodreads (and possibly other book sites) that allows you to register your favorite local libraries, and when you look up books on those services, it automatically searches and shows you which are available at your local library. One click and you can usually download or reserve a copy quickly for pick up.
The resolve.alias option is used to make sure that only one copy of the Svelte runtime is bundled in the app, even if you are npm linking in dependencies with their own copy of the svelte package. Having multiple copies of the internal scheduler in an app, besides being inefficient, can also cause various problems.
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.
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.
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.
Meat:
validate={values => formValidation.validateForm(values)}
Focus on your application: forget about forms details like I'm dirty, field touched...
Form Validation
return { type: "COUNTRY_BLACK_LIST", succeeded, message: succeeded ? "" : "This country is not available" }
It is easily extensible (already implemented Final Form and Formik plugin extensions).
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.
Fonk is framework extension, and can be easily plugged into many libraries / frameworks, in this documentation you will find integrations with:
Vue Final Form A form state management system for Vue that uses Final Form under the hood.
But it sounds like the library could use some way to setTouched()
unidad_COVID2019,biblioteca,favorito
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.
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.
If something isn't a great idea, the tools should support that approach
should => shouldn't
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.
Add new plugin Recaptcha3Token that sends the reCaptcha v3 token to the back-end when the form is valid
that a better and cleaner approach would be to use computed properties and a validation library that is decoupled for the UI (like hapi/joi).
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 a perfectly good alternative and uses the same interface as matt esch's virtual-dom
A JavaScript DOM model supporting element creation, diff computation and patch operations for efficient re-rendering
virtual-dom exposes a set of objects designed for representing DOM nodes. A "Document Object Model Model" might seem like a strange term, but it is exactly that. It's a native JavaScript tree structure that represents a native DOM node tree.
virtual-dom is a collection of modules designed to provide a declarative way of representing the DOM for your app. So instead of updating the DOM when your application state changes, you simply create a virtual tree or VTree, which looks like the DOM state that you want. virtual-dom will then figure out how to make the DOM look like this efficiently without recreating all of the DOM nodes.
The problem is that not all tooling supports adding new dependencies from a transform. The first step is figuring out how this can be done idiomatically in the current ecosystem.
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!
interfaces
unified is an interface for processing text using syntax trees.
It’s what powers remark (Markdown), retext (natural language), and rehype (HTML), and allows for processing between formats.
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.
Our custom useEffect is not idiomatic Svelte.
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.
Beautiful, except that switching albums does not update the PhotoGrid. This is not the automatic reactivity we were promised by Svelte.
We want to improve this while keeping both the API and the semantics and behavior as Reactish as possible.
Recoil
It provides several capabilities that are difficult to achieve with React alone, while being compatible with the newest features of React.
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.
While you could use a map function for loops they aren't optimized.
Solid supports spread operator on native elements and Components.
In general it is recommended you handle forms in this "controlled" manner. In some cases it might make sense to manage the form state outside of Solid via refs. These "uncontrolled" forms can also work. Just be conscious of the difference as mixing approaches can lead to unexpected results.
This is just a library not a Framework.
Wait what? No runtime. How does that work? Well, obviously JavaScript executes at runtime, so was he saying he doesn't reuse any code? Well as it turns out the message here has changed. I looked and sure enough there was a runtime. Of course there was.
A library is a set of functions you can use in your project. It does not care how and where you use that functionality. A framework tells you how to write code with the framework you are working with so you can make the best use of patterns, architecture, and functions in a framework. A framework can encompass a library.
this is a common Svelte idiom for manually invalidating something that might have been mutated without there being a visible = sign somewhere
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.
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.
but would it be reasonable to expect svelte-select to handle that so that consumers of this lib don't have to do all that?
Rollup builds atop Browserify and Webpack's lineage to make it possible to easily consume those packages, while looking to the future of JS modules.
When you publish this module, you do not want to bundle React, for the reasons described above. (It would be even worse to bundle React in a library, because then its copy would duplicate that loaded by the application!) But the fix is slightly different for a library than an application. In this library's Rollup configuration, we only want to specify external, not globals:
As you've probably already figured out it's the last output definition that should be by legacy apps. With the above output configuration we allow consuming the component both from a modern app with a Node.js-based environment and from legacy apps.
But library users are more numerous, and so their needs are more important.
small modules allow library authors to become lazy. Why include that six-line helper function when you can do a one-line `require`?
These are all things that make your life as a library author easier.
I think I know why: it’s because the small modules philosophy favours library authors (like Sindre) at the ultimate expense of library users.
I don't understand why it just launches the mutation once and then it throws the error Function called outside component initialization, the only way to make it work is to do something like $: result = mutation(...) but it doesn't make sense, I don't want to run the mutation after each keystroke.
We’re still working on idiomatic Svelte APIs so this one’s also on our list to figure out what the best way forward is
For context, the previous API had a lazy promise. Currently I’m thinking we could just return a closure like in the React API
This is the same as useEffect in React, incidentally — the function must be synchronous in order to avoid race conditions.
urql/packages/svelte-urql/ Go to file Add file Go to file Create new file Upload files urql/packages/svelte-urql/
I assume that soon developers will publish more components for svelte, and any possible class conflict is problematic. Yeah, it's rare case, but it is.
There are work arounds, but nothing clean. I just feel like this should be functionality that should be part of the slot feature.
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.
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.
Does it look like a decorator plugin in Ractive, right
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.
Actions add additional functionality to elements within your component's template that may be difficult to add with other mechanisms. Examples of functionality which actions makes trivial to attach are:
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.
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.)
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!)
For reference: an independent implementation