Comments (10)
@parkjs814 take a look at the sources here https://skalman.github.io/UglifyJS-online/
This person made a wrapper around uglify to make it run client-side.
from algorithm-visualizer.
No worries about it :)
I have removed those dependencies while I implement multiple tracers.
Check out the dev
branch. (I'm still working on it.)
from algorithm-visualizer.
I figured out that we don't even need to use uglify.
I just moved all the global variables into an anonymous function, and changed all references to it.
fixed at ceadfa4
from algorithm-visualizer.
Mhm, that can be a problem. Great point. In which way are you fixing this issue?
from algorithm-visualizer.
I'm a bit confused at this point. The simplest way is to use Watch points, but they are not suitable for production.
I'm also looking into this
The problem is that variables like codeEditor, dataEditor, etc. (who are susceptible) are global. So no matter where you execute eval() from, it WILL overwrite the variables of the same name.
from algorithm-visualizer.
How do you think about uglifying the code internally before eval()
it?
Then all the names of variables will have one or two letters, so that the global variables will not be overwritten.
from algorithm-visualizer.
You're right! we can do that.
But we can't uglify the variables tracer and G (in case of Graph algorithms) because these are then being used by script.js. We rely on eval () to create these 2 variables in the global scope so we can use them.
But otherwise it seems like a very good solution
from algorithm-visualizer.
I was looking for uglifying library for the client side, but it seems most of them are for node.js.
Do you know any?
from algorithm-visualizer.
This seems fantastic. But its not solving the issue, i.e., all variable names remain intact even after the minification.
from algorithm-visualizer.
That's not a big deal. We can just avoid short-named variables.
What I'm worrying about is that it could lower the performance of realtime-rendering.
from algorithm-visualizer.
Related Issues (20)
- Hello, dear author, can you support C++? HOT 2
- My idea remind me that : 无法打开包括文件:“stdbool.h”: No such file or directory so l can run the project。how can l fix that? HOT 1
- I'm a new coder, i have no idae to use it HOT 3
- Need Support for C/C++ as well HOT 2
- please make a c++
- quite wide
- Check the certificate for tracer.js HOT 1
- C language HOT 2
- Algo HOT 2
- CONTRIBUTING.md file content doesn't match its purpose HOT 1
- Will this project continue to be maintained?
- 堆排序算法的可视化不是很好,应该把树画出来
- 如果有红黑树就好了
- how to run this project on local pc HOT 2
- is it possible Support for C/C++ ,if i have set this project run on my local ubuntu 22.04
- need a API demo(or example)? HOT 2
- linux上部署不成功,有大佬部署成功的吗? HOT 5
- How to use these? HOT 3
- Update readme HOT 2
- Bro your website is not opening is saying it is no safe
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from algorithm-visualizer.