Closed 1000TurquoisePogs closed 1 year ago
https://github.com/TSTerminal/TSTerm/blob/main/lib/tsterm.min.js is missing the wrapping of
! function(exports) { ... return exports;}("undefined"==typeof my_global_name?my_global_name={}:my_global_name);
Which is what is done in https://github.com/zowe/tn3270-ng2/blob/v2.x/staging/webClient/src/lib/js/tn3270.js
We need that because the terminal app initializes the terminal library by calling functions of off a global, such as what you see off of "org_zowe_terminal_tn3270" within https://github.com/zowe/tn3270-ng2/blob/v2.x/staging/webClient/src/app/terminal.ts#L14
tsterm shouldnt be using the global named "org_zowe_terminal_tn3270", because its not zowe. It could use a global name like "org_omp_tsterm_tn3270"
The tsterm build uses "rollup" and it looks like the rollup config file is here https://github.com/TSTerminal/TSTerm/blob/main/rollup.config.js and there should be some way to configure rollup so that it adds that type of wrapper automatically.
note: i'm pretty sure the solution in rollup is --format iife --name "org_omp_tsterm_tn3270" but you gotta try it.
--format iife --name "org_omp_tsterm_tn3270"
PR14 done.
https://github.com/TSTerminal/TSTerm/blob/main/lib/tsterm.min.js is missing the wrapping of
Which is what is done in https://github.com/zowe/tn3270-ng2/blob/v2.x/staging/webClient/src/lib/js/tn3270.js
We need that because the terminal app initializes the terminal library by calling functions of off a global, such as what you see off of "org_zowe_terminal_tn3270" within https://github.com/zowe/tn3270-ng2/blob/v2.x/staging/webClient/src/app/terminal.ts#L14
tsterm shouldnt be using the global named "org_zowe_terminal_tn3270", because its not zowe. It could use a global name like "org_omp_tsterm_tn3270"
The tsterm build uses "rollup" and it looks like the rollup config file is here https://github.com/TSTerminal/TSTerm/blob/main/rollup.config.js and there should be some way to configure rollup so that it adds that type of wrapper automatically.
note: i'm pretty sure the solution in rollup is
--format iife --name "org_omp_tsterm_tn3270"
but you gotta try it.