moodle: Automatic plugin updates for developing offline - moodle

I am developing a plugin for moodle. Every time want to review the results of the things I have changed in the code it is necessary to update all plugins. This means I have to open a notification page and click on update. I waste a lot time by doing this. Furthermore, it requires a internet connection to check for updates online.
Is there a way to update plugins that are under development automatically?
UPDATE
Especially changes to the AMD-Files do not become updated. The following steps I have tried:
First try:
change js-file inside AMD folder
[optional] delete minified version of the js-file
run grunt (uglify)
page reload in firefox or chrome
=> no changes visible after page reload in firefox
Second try:
change js-file inside AMD folder
run grunt (uglify)
change version number at version.php
updated plugin at moodle / administration / site administration / notifications
page reload in firefox or chrome
=> changes are visible
Cache was disabled in the browser and inside moodle

You shouldn't need to do any form of update if you have just made changes to your code - make the change, save it, refresh the page.
If you have changed any language strings or CSS or created any new autoloading classes, then Purge the site caches to see the new version.
If debugging is on, you shouldn't need to purge any caches for javascript changes (but you can also set $CFG->jsrev = -1; in config.php, as that sometimes helps).
The only times (during development) when you really need to bump the version number and then visit the notifications page (which doesn't require an internet connection) is if you are adding/removing a capability, changing the database tables in some way or making changes to one of the other files in the 'db/' subfolder (e.g. caches.php, messages.php).

I changed the config.php in the root folder of moodle and added the following lines:
$CFG->cachejs = false;
$CFG->debug = DEBUG_DEVELOPER;
Finally, I saw all changes made to Javascript files stored in mod/my-plugin/amd/src directly on the page without running grunt.
It was not enough to set the debugging options under administration / site administration / development / debugging.

Related

How do I reload the page after making changes to JavaScript code on source panel of chrome dev tool

I was profiling bbc page and I noticed some jankiness. I got to the culprit JavaScript file and it had an observer on scroll. I made the changes. However when I reload the page all my changes are gone.
I could have used workspaces but since I do not have bbc code I can't use it.
My question is after making local changes to the file how do I tell chrome devtool to use this changed file and then reload the page so that I could do performance profiling again.
This feature is in development as a Local Overrides experiment. However, it is not yet stable (some testers reporting it simply crashes the browser) so using the experiment as it is now is not recommended. As it is, in Stable Chrome DevTools there is no functionality for this built in.

Phoenix Live Reload working intermittently

I'm trying to figure out why Phoenix live reload works "most of the time" but not always.
My config.exs has:
# Watch static and templates for browser reloading.
config :bespoke_work, BespokeWork.Web.Endpoint,
live_reload: [
patterns: [
~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$},
~r{priv/gettext/.*(po)$},
~r{lib/bespoke_work/web/views/.*(ex)$},
~r{lib/bespoke_work/web/templates/.*(eex)$}
]
]
Whenever I edit one of the templates that ends in *.html.eex it usually works right away. But sometimes it does not. And when live reload doesn't work, no matter how many times I try to refresh the page / clear the cache or go salsa dancing, it just won't refresh the content.
My folder structure is like this:
/name/lib/name/web/templates/page
|-index.html.eex
|-menu.html.eex
|-module[1-5].html.eex
(there are five modules files, the first being module1.html.eex and so on)
Is the fact that the files are not directly under the templates folder a problem? (They're inside the templates/page folder)
The index.html is rendered inside the layout/app.html.eex layout and, inside the index file, there are calls to render the menu and the other modules.
Not sure what I am missing here.
I tried running mix phx.digest manually, it didn't made any difference (it is already being triggered whenever needed).
How can I fix this behavior?
Phoenix 1.3.0-rc.2
Phoenix Live Reload 1.0.8
Elixir 1.4.5
Erlang/OTP 20
Impaciência 10
I found the culprit: Spacemacs lock files.
As part of my workflow is working with Front-end specs, sometimes I need to adjust things by the pixel or make some other minor (and really fast) adjustment: as when you noticed you have a typo or something.
In those situations, what appears to happen is the following:
I switch to Spacemacs.
As soon as I start typing (switch to Evil Mode insert state), Spacemacs creates an lock file in the same directory.
Phoenix Live Reload notices the change in the directory and well, live reloads the code (which is still the same because the auto-save file is not used by the app).
When I save the altered file, usually right away, Live Reload was still refreshing the browser from the detected auto-save file creation.
Although I still can't understand why simply refreshing the screen (with Browser Cache disabled on Chrome) won't display the proper code.

debugging amd js codes in moodle whithout purge caches

When I want to debug javascript codes in AMD module in moodle its too hard to purge all site caches in each edit is there any way for debugging?
on the other hand when I purge all caches it takes much time to load again.
I tried enabling theme developer mode but my problem not solved.
Go to
Site administration ► Appearance ► AJAX and Javascript
Turn off "Cache Javascript" and save.
This will make the system not compress and cache the javascript so your changes will take effect right away. This also means that only changes you make in the amd/src will be shown. You should generate the amd/build javascript using grunt once you are ready to go to production and turn the cache back on.

Get the real-time web design preview from the browser

Assume that I have two monitors assigned to my pc. Now I want to get the preview of a web site while coding it. Is there anyway to do this?
eg:- Do the coding from sublime text from a one monitor and the meantime watch the output from the Firefox web browser.
I have used live.js for this more than once. It can work either as a bookmarklet or embedded on your page, and it works in any browser as it's not an extension. Also requires no other software to work.
The downside is it that it will flood your developer tools with HEAD requests every second or so to determine when to reload things. That's the cost of not having to install external software.
You can use the LiveReload plugin for SublimeText. It listens for changes to your code files and updates them in the browser in real time.
Also, do not forget to add the respective browser extension. That should save you from adding any scripts into your page.
You could use yeoman ( with Grunt or Gulp depends on which generator you want to use ).

NetBeans: Code changes to javascript & css files are not reflected in browser after saving

This is driving me crazy. I'm developing an app in the NetBeans IDE in PHP, using the CodeIgnitor framework. I am making code changes to js and css files in NetBeans, saving them but the files the browser is loading do not contain the code changes. When I open the files directly outside of NetBeans, the saved changes aren't there.
I'm storing the javascript & css files in a folder called static, which is outside of the 'application' directory in CodeIgnitor. What's weird is any code changes in PHP files work fine. I'm guessing NetBeans is saving the changes to the js/css files somewhere else but can't find them on my hard drive. This just started happening, it was working 'normally' before.
Thanks for the help.
Al
I had the same problem, upon investigation, my browser cached my old style sheet that I had recently updated. Clearing the cache and refreshing showed my new styling, after around 20 minutes of frustration :D
This problem occurs due to browser cache. For chrome while testing open the developer mode by pressing the F12 key and set cache disabled in the network tab as shown in Image below. It will ensure that you will always get updated version of the page files.
Check to make sure that the files are where you think they are. I would imagine that CodeIgniter is rewriting the request to be inside your application folder and thus bypassing your specific folder.