szabesz Posted January 2, 2023 Share Posted January 2, 2023 Happy new year to all! @adrian My question is in the title :) The ace-editor folder is ~11.7MB with ~444 files, along with snippets, themes and such. Personally, I do not think I/we need them all. Would it be possible to make it a lot slimmer somehow? cheers, Szabesz Link to comment Share on other sites More sharing options...
adrian Posted January 10, 2023 Share Posted January 10, 2023 Hi @szabesz - probably not, but I didn't want to limit users to specific themes and I also didn't want to remove syntax highlighting and linting for languages just because I don't think they will be needed. I guess my main reason though is that it's much easier for me to just update the entire set without needing to limit updates each time and in the scheme of things, I don't see 11MB as an issue given that one high resolution image upload might easily equal this. Keep in mind that none of these are loaded except those that are needed. Do you have a specific need to reduce it? 1 Link to comment Share on other sites More sharing options...
Robin S Posted January 10, 2023 Share Posted January 10, 2023 1 hour ago, adrian said: I guess my main reason though is that it's much easier for me to just update the entire set without needing to limit updates each time and in the scheme of things, I don't see 11MB as an issue given that one high resolution image upload might easily equal this I agree that it's not a major issue, but it would still be nice to slim down the total TracyDebugger size because it's a module that receives frequent updates (thanks! ❤️) and so I'm downloading it regularly. Ace makes up approximately 80% of the total TracyDebugger size. Could it maybe be loaded via a CDN? https://cdnjs.com/libraries/ace Also, I've heard good things about Monaco (possible replacement for Ace): https://cdnjs.com/libraries/monaco-editor 1 Link to comment Share on other sites More sharing options...
teppo Posted January 10, 2023 Share Posted January 10, 2023 36 minutes ago, Robin S said: Could it maybe be loaded via a CDN? https://cdnjs.com/libraries/ace As someone who does a lot of local development, sometimes with no Internet access or extremely slow one (e.g. while travelling), this would not be preferable. Having everything available locally guarantees that things work as expected. Also it guarantees that the version I have can't be compromised by malicious actors. Assuming, of course, that it was safe in the first place ? Personally I don't have an issue with Ace, but if Monaco (or something else) does similar things with less overhead then why not ? 2 Link to comment Share on other sites More sharing options...
szabesz Posted January 10, 2023 Author Share Posted January 10, 2023 2 hours ago, adrian said: my main reason though is that it's much easier for me to just update the entire set I quite understand it, so please simply forget my question if such a task would add any considerable amount of time to the maintenance of the module. I just saw that in your Admin Actions module the Ace editor files add up to only about 1MB, and I simply use Ace in these modules the way they are configured by default, and I will highly probably never be interested in more than that. So to me, what is not used is just "ballast". 44 minutes ago, Robin S said: Also, I've heard good things about Monaco (possible replacement for Ace): https://cdnjs.com/libraries/monaco-editor Looks like the distribution directory of this editor is about the same size as Ace's (maybe even a bit bigger) and if so, it might not be an answer to the "issue". Also, (quote) "The Monaco editor is not supported in mobile browsers or mobile web frameworks." which is not an issue to me as I never use the ProcessWire admin on a mobile, so I do not even know if Ace supports that or not. Link to comment Share on other sites More sharing options...
szabesz Posted January 10, 2023 Author Share Posted January 10, 2023 3 minutes ago, teppo said: As someone who does a lot of local development, sometimes with no Internet access or extremely slow one (e.g. while travelling), this would not be preferable. Having everything available locally guarantees that things work as expected. Also it guarantees that the version I have can't be compromised by malicious actors. Assuming, of course, that it was safe in the first place ? Quite agree! Personally I never implement anything relying on CDN because of the possible issues with external dependencies. Link to comment Share on other sites More sharing options...
adrian Posted January 10, 2023 Share Posted January 10, 2023 4 hours ago, szabesz said: I just saw that in your Admin Actions module the Ace editor files add up to only about 1MB, and I simply use Ace in these modules the way they are configured by default, and I will highly probably never be interested in more than that. The difference with Admin Actions is that it's always going to be PHP code and also it's not being used to edit code, just view it. 5 hours ago, Robin S said: Also, I've heard good things about Monaco (possible replacement for Ace): https://cdnjs.com/libraries/monaco-editor I did look at Monaco when I was initially developing the Console panel and came across some issues I couldn't resolve (although I don't remember what they were now). 4 hours ago, szabesz said: I simply use Ace in these modules the way they are configured by default, and I will highly probably never be interested in more than that. So to me, what is not used is just "ballast". I could probably get away with only packaging one theme and remove the config options, but because I think so many of use the Console panel so much, I think giving users the ability to match the styling to their preferences is a pretty nice bonus. As for language syntax highlighting / linting etc - there are certainly options that could be removed like elixir, csharp, and lots of others, but I wouldn't want to limit to just PHP, HTML, CSS, JS. What if someone is working in latte or twig or coding JS in CoffeeScript or they are connecting to a separate Postgres DB and could make use of (mode-pgsql), or editing some SVG code (I sometimes use the Console panel for this). Keep in mind that the entire Tracy module zip file is only 3.5MB (https://github.com/adrianbj/TracyDebugger/archive/refs/heads/master.zip) so even if I removed all the extra Ace files, it might get down to ~1MB. I am just not certain I want to remove functionality that someone might use for the sake of a couple of MB. Note that I used to do exactly what you are asking for: https://github.com/adrianbj/TracyDebugger/tree/3181668f6841ae9f75a9fe49e6e8331ab0c69fc4/scripts/ace-editor but as I mentioned, each time I update it, I have to manually copy across the new files rather than the entire set. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now