Code Monkey home page Code Monkey logo

Comments (6)

dpvc avatar dpvc commented on May 30, 2024

would it make sense to generate a single file containing all the entities and import that statically?

There already is such a file: mathjax3/input/mathml/AllEntities.js. If you import that into your script, it will pre-load all the entities.

You are right that the file path is incorrect (there was a restructuring that wasn't reflected here). That should be fixed.

The asynchLoad() code needs to be revisited. It was needed initially during the period when we still had version 2 code hooked in as we were rewriting the various modules, but it may be eliminated in the end. In any case, I have been thinking about making it be conditionally compiled so that it does not cause web pack warnings.

from mathjax-src.

hubgit avatar hubgit commented on May 30, 2024

Thanks, mathjax3/input/mathml/AllEntities.js looks useful in theory, although I think the imports might need to be changed to be relative (i.e. import './entities/a.js'; instead of import 'entities/a.js';)?

In any case, I have been thinking about making it be conditionally compiled so that it does not cause webpack warnings.

Anything that gets rid of the warnings sounds good to me :)

from mathjax-src.

dpvc avatar dpvc commented on May 30, 2024

I think you are right. I thought the file had been used before, but clearly it was never properly tested. Sigh. Thanks for the catch.

from mathjax-src.

dpvc avatar dpvc commented on May 30, 2024

A fix for the entity importing (#92) has been merged into the master and alpha branches, as well as updates to the asyncLoad() function to make it work from any directory, and to provide a disabled version for use with webpack to avoid the warning messages. For that, you need to add

        new webpack.NormalModuleReplacementPlugin(
            /AsyncLoad\.js/,
            function (resource) {
                resource.request = resource.request.replace(/AsyncLoad/,"AsyncLoad-disabled");
            }
        )

to the plugins array for your webpack configuration. This will replace the the asynchLoad() function with one that always returns failure (and doesn't try to load any files).

from mathjax-src.

hubgit avatar hubgit commented on May 30, 2024

This is all good now, thanks @dpvc ⭐️

from mathjax-src.

stnor avatar stnor commented on May 30, 2024

See this comment for a better/safer approach.

from mathjax-src.

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.