Replace url
dependency with modern URL API?
#9413
MuTsunTsai
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
I think it would be great to replace package packages/utils/src/index.ts /**
* Node.js compatible URL utilities.
* @see https://www.npmjs.com/package/url
* @memberof PIXI.utils
* @name url
* @member {object}
+ * @deprecated since 7.3.0
*/
export * from './url'; packages/utils/src/url.tsexport const url = {
/**
* @deprecated since 7.3.0
*/
parse: {
get()
{
// #if _DEBUG
deprecation('7.3.0', 'utils.url.parse is deprecated, use native URL API instead');
// #endif
return _parse as ParseFunction;
},
},
// And format & resolve
}; |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@pixi/utils has a dependency on
url
. As far as I can tell, it is essentially used in only one place:https://github.com/pixijs/pixijs/blob/dev/packages/utils/src/network/determineCrossOrigin.ts
and apparently this file hasn't been touched for years (there's even a comment about IE9 which should be long dropped by Pixi). I believe that the
url
dependency and thetempAnchor
stuff can all be replaced by simplyThis works in all supposedly targeted browsers, and can save us a few dependencies to bundle and the annoying "querystring deprecated" warning.
The only thing I hesitate about making a PR is that @pixi/utils actually exports
url
(in https://github.com/pixijs/pixijs/blob/dev/packages/utils/src/index.ts), and I'm not entirely sure if it is used elsewhere in the ecosystem. What do you guys think?Beta Was this translation helpful? Give feedback.
All reactions