שינויים בקוד בדיקת אפליקציה חי לא משתקפים ב-front-end

Hi,

Coming from developing on joomla/wordpress I am curious over discourse backend file modification functionning through docker.
I have read the documentation on how to create a plugin(How can I make my own Discourse plugins? - #2 by merefield), but I don’t want to do that yet, I just want to be able to test code live

On a non docker MVC installation, doing a modification on a file via ftp, it was instantly reflected and while with docker I understand the need to rebuild the app to apply permanent modification, what if you want to test things live?

Live test code modifications don’t seem to work :

For example, I want to disable searches for anonymous users so I edited :
/var/www/discourse/app/controllers/search_controller.rb by adding “if current_user.present?” after “def show” with an end at the bottom of the function.

I was surprised that this does not have any effect on front end, and even renaming the conrolller to search_controllerold would not have any effect on the searches.

But somehow, renaming an image in /var/www/discourse/public/images# would hide the image on front-end :slight_smile: !

Can anyone please tell me how things work here, is there another cached version of the system more than just the app that starts from its image?

Thank you

Ok, I found that code gets modified if I modify the files in ./javascripts/discourse/node_modules/.embroider/rewritten-app/
It feels better now :slight_smile:

לייק 1

זה נראה יותר מאנטי-תבנית.

זה כנראה יוחלף בכל build.

עיין בחומר ב-Documentation > Developer Guides ובאינספור דוגמאות אמיתיות של קוד פתוח כדי לראות כיצד לשנות את ה-front end דרך Theme component ואת ה-front וה-back דרך #plugins

2 לייקים

תודה על השיתוף! אני אבדוק את זה ואולי אעסוק בזה ברצינות רבה יותר בשלב מסוים, לעת עתה, רק רציתי לבדוק שינויים חיים ולא מבין למה הם לא מופיעים בחזית בקלות כמו שהיה עם FTP על ג’ומלה/וורדפרס.