Giter VIP home page Giter VIP logo

Comments (9)

gwhitney avatar gwhitney commented on June 25, 2024

Digging a bit further, according to marcj/css-element-queries#309 one can replace ResizeSensor altogether with a very lightweight wrapper around ResizeObserver, which is built in to all modern browsers for quite some time. Since css-element-queries has a few PRs that have been open for 2-3 years, I don't expect to get it to change. Hence, with your consent and guidance, I'd like to remove it from x_ite one way or another. Please let me know whether you think it is still used/needed, in which case I will try to replace it with ResizeObserver, or whether I should simply try to prune ResizeSensor altogether. Thanks.

from x_ite.

gwhitney avatar gwhitney commented on June 25, 2024

P.S. Of course I could patch the x_ite bundle, and that is what I am doing for testing, but as you may or may not know, the Mozilla organization will refuse to sign extensions that patch any third-party libraries they use; all third-party libraries must be delivered exactly as released by the author. And without Mozilla's signature, extensions are not allowed to be installed in anyone's Firefox browser. That's why for my project to move forward, I really need to help produce an official version of the x_ite bundle that can be loaded in an extension.

from x_ite.

create3000 avatar create3000 commented on June 25, 2024

That's the first time I hear from ResizeObserver, but indeed we should use it now. :-)

ResizeSensor is used in src/x_ite/Browser/Rendering/X3DRenderingContext.js, which should then be replaced by ResizeObserver.

from x_ite.

gwhitney avatar gwhitney commented on June 25, 2024

Ah, not sure how I missed it in there. I will replace it with ResizeObserver and update my PR.

from x_ite.

create3000 avatar create3000 commented on June 25, 2024

Merged your PR yesterday and with a small adjustment it works very well. Thank you very much for your contribution.

from x_ite.

create3000 avatar create3000 commented on June 25, 2024

I don't know if it will become a problem for your project, but in the X_ITE source code there are some new Function ("...") statements:

return Function (/* js */ `with (arguments [0])

var evaluator = new Function([code.join("\n"), "; return ", functionName].join(""))();

These code lines are essential for Script node and NURBS rendering.

from x_ite.

gwhitney avatar gwhitney commented on June 25, 2024

Thanks for fixing up my PR to remove ResizeSensor, it's very much appreciated and I look forward to the release.

As to your question about whether the Scripting and nurbs uses of new Function("....") will cause problems for my project: I do think it means that if inside my extension I try to view x3d files that use Script nodes or NURBS, they will fail to execute. However, I have already verified (with my locally patched version of x_ite.mjs) that at least the large majority of files I am trying to display do not use these parts of X3D. And fortunately, the ban on Function("...code...") is not against such an expression occurring, but rather against such an expression being executed. Eventually in my extension I will need to catch the errors that occur when it tries to execute a new Function("...") and fail gracefully (maybe report to the user they are trying to view a file with script/nurbs and those are not supported), but that will be a much later polishing step since basically it is working now for the files I care about. Thanks!

from x_ite.

create3000 avatar create3000 commented on June 25, 2024

New version 8.12.5 with latest changes is out now.

from x_ite.

gwhitney avatar gwhitney commented on June 25, 2024

And working nicely for me in a Firefox extension, thank you.

from x_ite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.