imgeng / imageengine-react Goto Github PK
View Code? Open in Web Editor NEWProvides custom components for integrating ImageEngine into React web apps
License: MIT License
Provides custom components for integrating ImageEngine into React web apps
License: MIT License
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
This repository currently has no open or pending branches.
.github/workflows/build.yml
actions/checkout v4
actions/setup-node v4
.github/workflows/publish.yml
actions/checkout v4
actions/setup-node v4
package.json
@imageengine/imageengine-helpers ^0.2.1
@types/react ^18.2.47
typescript ^5.2.2
react ^17.0.2 || ^18.0.0
maxdpr is a url directive wich define a maxumum DPR (Device Pixel Ratio) to consider when resizing an image. maxdpr can take values from 1 to 4 (including).
image.png?imgeng=/maxdpr_2 will cap the dpr to 2 even if the device has a a screen supporting dpr of 4, for example.
Hi,
I was doing some work with creating custom loaders with Next.js' Image
component and ran into the issue of creating the correct query strings for IE's urls.
So instead of re-writing all that logic, I thought it would be useful to use the constructUrl
function that this package has. While it's possible to import that by giving the correct path inside the node_modules
folder, e.g:
import { constructUrl } from "@imageengine/react/build/utils/index.js";
It doesn't look that official. If for instance the underlying function names, or file structure changes the import would be broken.
My thought was that if this was exposed as a normal export, then perhaps these sort of "helpers" could be packaged individually in another npm package. This React Image
package could then use that lib, and anyone wanting to write a custom component, even outside of React, could choose to install that smaller utility package and benefit from having vetted, up to date, helpers. For instance if something would change in the directives
that IE accepts itself, then it would be just a matter of updating those helpers since the logic to translate the set of directives into the query string would be responsibility of the package. It's not like there's a lot of upside, but seems like a good option to have nonetheless.
Anyway, for my immediate case just having it exported "officially" would work. Would this be something possible to do?
Thanks
imageengine-react/src/utils/index.tsx
Lines 4 to 6 in 4d42e89
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.