frameright / react-image-display-control Goto Github PK
View Code? Open in Web Editor NEW๐ Next-gen responsive images in React
Home Page: https://react.frameright.io
License: MIT License
๐ Next-gen responsive images in React
Home Page: https://react.frameright.io
License: MIT License
As for #6, out of curiosity, what happens if we wrap an unpic
<Image>
with our React component?
Out of curiosity, what happens if we do
<ImageDisplayControl>
<TwicImg src=... />
</ImageDisplayControl>
By following https://github.com/Frameright/image-display-control-web-component/blob/main/image-display-control/docs/explanation/browsers.md#resizeobserver-polyfill we can support older Safari versions.
When doing
<ImageDisplayControl>
<img src=... />
</ImageDisplayControl>
an is="image-display-control"
attribute will be added to the <img>
tag in order to turn it into an Image Display Control web component. This is problematic however if the <img>
tag already had another is=
attribute, e.g.
<ImageDisplayControl>
<img is="already-another-component" src=... />
</ImageDisplayControl>
An <img>
tag can't be two web components at the same time. We should at least issue a warning if this happens.
For example, if the user writes
<ImageDisplayControl data-disabled="all">
<Image src="..." />
</ImageDisplayControl>
instead of
<ImageDisplayControl>
<Image src="..." data-disabled="all" />
</ImageDisplayControl>
See:
We scaffolded this project using https://github.com/jaredpalmer/tsdx, which isn't maintained anymore, leading to issues and workarounds like the overrides
in https://github.com/Frameright/react-image-display-control/blob/main/package.json
In our package.json
scripts calling tsdx
, most of the time it is only a wrapper around other well-known open-source tools, so we should be able to get rid of it.
This would allow some user CSS rules to target that and display something while things are loading.
Somewhat related to 2. CSS class marking well-functioning components
in Frameright/image-display-control-web-component#7
e.g. using something like vuepress or vitepress?
<ImageDisplayControl>
<Image src=... />
</ImageDisplayControl>
In case the child's src=
is constructed for example based on its state, updated later asynchronously by a useEffect()
, we (the parent <ImageDisplayControl>
) won't notice the change, and so we won't fetch the new image regions corresponding to the new image.
How to solve this? With a MutationObserver
? With some kind of subscription to the children's React states?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.