Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live reloading of webapp resources broken #299

Closed
timja opened this issue Feb 22, 2022 · 7 comments · Fixed by #300
Closed

Live reloading of webapp resources broken #299

timja opened this issue Feb 22, 2022 · 7 comments · Fixed by #300
Labels

Comments

@timja
Copy link
Member

timja commented Feb 22, 2022

Caused by #208

Picked up when updating theme plugins in jenkinsci/theme-manager-plugin#75

To reproduce:

Run this plugin:
https://github.com/jenkinsci/solarized-theme-plugin

Bump parent pom to 4.25

Run with mvn hpi:run
Configure the theme on system config page

Change a color, e.g. one in https://github.com/jenkinsci/solarized-theme-plugin/blob/master/src/main/webapp/solarized-dark.css#L3

Refresh the page.

It will get updated.

Bump parent pom to 4.26 (includes #208).

Repeat above, file won't be live reloaded

@sephiroth-j
Copy link
Member

If you only run mvn clean hpi:run, the resource-path will still point to "src\main\webapp". If the output directory exists, e.g. after packaging, then the output directory will be used for resource-path. This is important to support webResources and its targetPath. In this case, the same structure of the final hpi package will be used to run the plugin locally. You can then edit the files in the output directory instead of the source directory and you will see the changes immediately (live reloading).

I am confident that there is another option instead of reverting #208. However, the decision is up to others.

It would certainly be possible to include the various directories of each webResource in the list of directories that are monitored for changes. The only thing I do not know yet is how to trigger the output directory update (packaging goal).

@timja
Copy link
Member Author

timja commented Feb 23, 2022

If we can get something that works sanely then we don't need to revert it.

I don't think mvn clean hpi:run is a good solution though.

edit the files in the output directory

Aware, very poor developer UX though.

@jglick
Copy link
Member

jglick commented Feb 23, 2022

I am confident that there is another option instead of reverting #208.

Perhaps, but unless the fix is immediately apparent, we prefer to revert first and leave the amended feature implementation for some unspecified future time. Was there a particular plugin relying on this feature? First I had heard of it.

@timja
Copy link
Member Author

timja commented Feb 23, 2022

Feel free to re-revert on top you can pin to current pom for now.

@timja timja added the bug label Feb 23, 2022
@sephiroth-j
Copy link
Member

Was there a particular plugin relying on this feature? First I had heard of it.

Dependency-Track Plugin

@timja
Copy link
Member Author

timja commented Feb 23, 2022

better to just use something like esbuild or webpack imo.

@jglick
Copy link
Member

jglick commented Feb 23, 2022

Yeah IIUC there are more standard ways of packaging JS libs in Jenkins plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants