Skip to content

Refactor plugin structure to avoid inso bundling UI logic - #8892

Merged
jackkav merged 11 commits into
Kong:developfrom
jackkav:keep-inso-out-of-ui-code
Jul 22, 2025
Merged

Refactor plugin structure to avoid inso bundling UI logic#8892
jackkav merged 11 commits into
Kong:developfrom
jackkav:keep-inso-out-of-ui-code

Conversation

@jackkav

@jackkav jackkav commented Jul 21, 2025

Copy link
Copy Markdown
Contributor

Motivation: Prepares for renderer main separation by making it easier to identify which plugin contexts are used where.
Why: Because app context has imperative modal hooks which only work in the app, and only sometimes make the cli build fail.
Goal: exclude all react code from the inso bundle

  • move faker functions out of ui
  • dump common/export into import-export settings modal
  • split plugin barrel into individual exports
  • use renderer status to control app plugin context modals instead of whatever render purpose is
  • remove modal on plugin load failure and replace with console log
  • remove prompt and alert modal helps to remove indirect to help detect code paths
  • add window methods for plugins to use

'. Please contact the plugin author sharing the below stack trace to help them to ensure compatibility with the latest Insomnia.',
error: err,
});
console.error(`[plugin] Error while loading plugin from ${p}/${filename}:`, err);

Check notice

Code scanning / Semgrep OSS

Semgrep Finding: javascript.lang.security.audit.unsafe-formatstring.unsafe-formatstring Note

Detected string concatenation with a non-literal variable in a util.format / console.log function. If an attacker injects a format specifier in the string, it will forge the log message. Try to use constant values for the format string.
@jackkav
jackkav marked this pull request as ready for review July 21, 2025 20:21
ryan-willis
ryan-willis previously approved these changes Jul 21, 2025
@jackkav
jackkav force-pushed the keep-inso-out-of-ui-code branch from af57e8e to e250c9e Compare July 22, 2025 09:20
@jackkav
jackkav merged commit 90bd4d4 into Kong:develop Jul 22, 2025
10 checks passed
@jackkav
jackkav deleted the keep-inso-out-of-ui-code branch July 22, 2025 09:58
RoamingLost pushed a commit to RoamingLost/insomnia that referenced this pull request Aug 6, 2025
* extracting template functions to src

* move all ui export logic into ui

* remove modal from plugin init

* remove har from plugin api

* remove alert and prompt model shortcuts

* replace renderPurpose with renderer check

* split plugin barrel

* fix test

* use window to work around renderer imports

* restore har api

* fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants