importer: Add 'clear_cache' function to allow reloading of modules.#136
Open
importer: Add 'clear_cache' function to allow reloading of modules.#136
Conversation
We used to do something similar in very old versions of cjs before linuxmint/cinnamon@f01bd803d5ae89.
mtwebster
added a commit
to linuxmint/cinnamon
that referenced
this pull request
Jan 23, 2026
speed, fix backtrace uselessness.
- Drop 'custom' importer code, use native cjs importer
- Leave compatibility functions for require() and module.exports
Fixes/improves:
- Faster Cinnamon startup (for my random configuration, ~1550ms down
to ~1200ms).
- Improved logging.
- More consistent code (use of deprecated features will start getting
flagged and/or blocked for PRs in Cinnamon and spice repositories.
- Previous code was practically unmaintainable by sane people.
Logging - where before we'd see this useless garbage:
(cinnamon:4334): St-CRITICAL **: 22:19:57.081: st_widget_get_theme_node called on the widget [0x622f6579b3c0 StLabel.hourly-data ("...")] which is not in the stage.
== Stack trace for context 0x622f63105b50 ==
0 7ffd484001c0 b /usr/share/cinnamon/js/misc/fileUtils.js line 211 > Function:19086 (359f8e6c9c0 @ 279)
1 622f632b5d08 i /usr/share/cinnamon/js/misc/fileUtils.js line 211 > Function:19059 (359f8e6c970 @ 23)
2 7ffd48400ca0 b /usr/share/cinnamon/js/misc/fileUtils.js line 211 > Function:18976 (359f8e6c6a0 @ 807)
3 622f632b5b68 i /usr/share/cinnamon/js/misc/fileUtils.js line 211 > Function:19550 (359f8e6d650 @ 104)
4 622f632b5ab8 i /usr/share/cinnamon/js/misc/fileUtils.js line 211 > Function:19842 (359f8e6e2e0 @ 681)
5 622f632b5a08 i self-hosted:1461 (1eb5245b46f0 @ 30)
6 7ffd484015a0 b self-hosted:852 (359f8e92dd0 @ 15)
we now get:
(cinnamon:4334): St-CRITICAL **: 22:20:36.263: st_widget_get_theme_node called on the widget [0x58cf71ab5180 StLabel.hourly-data ("...")] which is not in the stage.
== Stack trace for context 0x58cf6ee74250 ==
0 7fffae294e10 b /home/mtwebster/.local/share/cinnamon/applets/weather@mockturtl/3.8/weather-applet.js:19084 (387d8e1fd1a0 @ 279)
1 58cf6eeac1f8 i /home/mtwebster/.local/share/cinnamon/applets/weather@mockturtl/3.8/weather-applet.js:19057 (387d8e1fd150 @ 23)
2 7fffae2958f0 b /home/mtwebster/.local/share/cinnamon/applets/weather@mockturtl/3.8/weather-applet.js:18974 (387d8e1fce20 @ 807)
3 58cf6eeac058 i /home/mtwebster/.local/share/cinnamon/applets/weather@mockturtl/3.8/weather-applet.js:19548 (387d8e1fddd0 @ 104)
4 58cf6eeabfa8 i /home/mtwebster/.local/share/cinnamon/applets/weather@mockturtl/3.8/weather-applet.js:19840 (387d8e1fea60 @ 681)
5 58cf6eeabef8 i self-hosted:1461 (2daaca0bf470 @ 30)
6 7fffae2961f0 b self-hosted:852 (e85adf8c6a0 @ 15)
Requires linuxmint/cjs#136 for xlet 'reload'
functionality to work.
mtwebster
added a commit
to linuxmint/cinnamon
that referenced
this pull request
Jan 23, 2026
speed, fix backtrace uselessness.
- Drop 'custom' importer code, use native cjs importer
- Leave compatibility functions for require() and module.exports
Fixes/improves:
- Faster Cinnamon startup (for my random configuration, ~1550ms down
to ~1200ms).
- Improved logging.
- More consistent code (use of deprecated features will start getting
flagged and/or blocked for PRs in Cinnamon and spice repositories.
- Previous code was practically unmaintainable by sane people.
Logging - where before we'd see this useless garbage:
(cinnamon:4334): St-CRITICAL **: 22:19:57.081: st_widget_get_theme_node called on the widget [0x622f6579b3c0 StLabel.hourly-data ("...")] which is not in the stage.
== Stack trace for context 0x622f63105b50 ==
0 7ffd484001c0 b /usr/share/cinnamon/js/misc/fileUtils.js line 211 > Function:19086 (359f8e6c9c0 @ 279)
1 622f632b5d08 i /usr/share/cinnamon/js/misc/fileUtils.js line 211 > Function:19059 (359f8e6c970 @ 23)
2 7ffd48400ca0 b /usr/share/cinnamon/js/misc/fileUtils.js line 211 > Function:18976 (359f8e6c6a0 @ 807)
3 622f632b5b68 i /usr/share/cinnamon/js/misc/fileUtils.js line 211 > Function:19550 (359f8e6d650 @ 104)
4 622f632b5ab8 i /usr/share/cinnamon/js/misc/fileUtils.js line 211 > Function:19842 (359f8e6e2e0 @ 681)
5 622f632b5a08 i self-hosted:1461 (1eb5245b46f0 @ 30)
6 7ffd484015a0 b self-hosted:852 (359f8e92dd0 @ 15)
we now get:
(cinnamon:4334): St-CRITICAL **: 22:20:36.263: st_widget_get_theme_node called on the widget [0x58cf71ab5180 StLabel.hourly-data ("...")] which is not in the stage.
== Stack trace for context 0x58cf6ee74250 ==
0 7fffae294e10 b /home/mtwebster/.local/share/cinnamon/applets/weather@mockturtl/3.8/weather-applet.js:19084 (387d8e1fd1a0 @ 279)
1 58cf6eeac1f8 i /home/mtwebster/.local/share/cinnamon/applets/weather@mockturtl/3.8/weather-applet.js:19057 (387d8e1fd150 @ 23)
2 7fffae2958f0 b /home/mtwebster/.local/share/cinnamon/applets/weather@mockturtl/3.8/weather-applet.js:18974 (387d8e1fce20 @ 807)
3 58cf6eeac058 i /home/mtwebster/.local/share/cinnamon/applets/weather@mockturtl/3.8/weather-applet.js:19548 (387d8e1fddd0 @ 104)
4 58cf6eeabfa8 i /home/mtwebster/.local/share/cinnamon/applets/weather@mockturtl/3.8/weather-applet.js:19840 (387d8e1fea60 @ 681)
5 58cf6eeabef8 i self-hosted:1461 (2daaca0bf470 @ 30)
6 7fffae2961f0 b self-hosted:852 (e85adf8c6a0 @ 15)
Requires linuxmint/cjs#136 for xlet 'reload'
functionality to work.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We used to do something similar in very old versions of cjs before linuxmint/cinnamon@f01bd803d5ae89.