Skip to content

Commit 4107044

Browse files
rashedmytprabhakk-mw
authored andcommitted
Infrastructural updates to support MATLAB R2025a.
1 parent 5fa4e6b commit 4107044

File tree

13 files changed

+16
-103
lines changed

13 files changed

+16
-103
lines changed

gui/src/components/App/index.jsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ import {
3131
selectLicensingMhlmHasEntitlements,
3232
selectIsEntitled,
3333
selectLicensingInfo,
34-
selectUseMOS,
35-
selectUseMRE,
3634
selectIsConcurrent,
3735
selectWasEverActive,
3836
selectIsConcurrencyEnabled,
@@ -73,8 +71,6 @@ function App () {
7371
const isAuthenticated = useSelector(selectIsAuthenticated);
7472
const authEnabled = useSelector(selectAuthEnabled);
7573
const licensingInfo = useSelector(selectLicensingInfo);
76-
const useMOS = useSelector(selectUseMOS);
77-
const useMRE = useSelector(selectUseMRE);
7874
const isSessionConcurrent = useSelector(selectIsConcurrent);
7975
const isActiveClient = useSelector(selectIsActiveClient);
8076
const isConcurrencyEnabled = useSelector(selectIsConcurrencyEnabled);
@@ -163,12 +159,11 @@ function App () {
163159
}, []);
164160

165161
const htmlToRenderMATLAB = () => {
166-
let theHtmlToRenderMATLAB = useMOS
167-
? 'index-matlabonlineserver.html'
168-
: 'index-jsd-cr.html';
169-
if (useMRE) {
170-
theHtmlToRenderMATLAB += `?mre=${encodeURIComponent(fullyQualifiedUrl)}`;
171-
}
162+
let theHtmlToRenderMATLAB = 'index-jsd-cr.html';
163+
164+
// Add mre query parameter
165+
theHtmlToRenderMATLAB += `?mre=${encodeURIComponent(fullyQualifiedUrl)}`;
166+
172167
return theHtmlToRenderMATLAB;
173168
};
174169

@@ -377,7 +372,6 @@ function App () {
377372
// process in development mode
378373

379374
// MW Internal Comment: See g2992889 for a discussion on why a FQDN is required in the MRE parameter.
380-
// MW Internal Comment: Using websocket on breaks some UI components : `./index-matlabonlineserver.html?websocket=on&mre=${fullyQualifiedUrl}`;
381375
const matlabUrl = process.env.NODE_ENV === 'development'
382376
? 'http://localhost:31515/index-jsd-cr.html'
383377
: `./${htmlToRenderMATLAB()}`;

gui/src/reducers/index.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,6 @@ export function authEnabled (state = false, action) {
4141
}
4242
}
4343

44-
// Stores information on whether to use MOS HTML while rendering MATLAB.
45-
export function useMOS (state = false, action) {
46-
switch (action.type) {
47-
case RECEIVE_ENV_CONFIG:
48-
return action.config.useMOS;
49-
default:
50-
return state;
51-
}
52-
}
53-
54-
// Stores information on whether to provide MRE parameter to HTML while rendering MATLAB.
55-
export function useMRE (state = false, action) {
56-
switch (action.type) {
57-
case RECEIVE_ENV_CONFIG:
58-
return action.config.useMRE;
59-
default:
60-
return state;
61-
}
62-
}
63-
6444
// Stores timeout duration for idle timer.
6545
export function idleTimeoutDuration (state = null, action) {
6646
switch (action.type) {
@@ -413,8 +393,6 @@ export const matlab = combineReducers({
413393
versionOnPath: matlabVersionOnPath,
414394
supportedVersions: supportedMatlabVersions,
415395
busyStatus: matlabBusyStatus,
416-
useMOS,
417-
useMRE
418396
});
419397

420398
export const serverStatus = combineReducers({

gui/src/selectors/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ export const selectServerStatusFetchFailCount = state => state.serverStatus.fetc
1919
export const selectLoadUrl = state => state.loadUrl;
2020
export const selectError = state => state.error;
2121
export const selectWarnings = state => state.warnings;
22-
export const selectUseMOS = state => state.matlab.useMOS === true;
23-
export const selectUseMRE = state => state.matlab.useMRE === true;
2422
export const selectAuthEnabled = state => state.authentication.enabled;
2523
export const selectAuthToken = state => state.authentication.token;
2624
export const selectIsAuthenticated = state => state.authentication.status === true;

gui/src/test/utils/responses.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ export const getEnvConfigResponse = {
2828
doc_url: state.envConfig.doc_url,
2929
extension_name: state.envConfig.extension_name,
3030
extension_name_short_description: state.envConfig.extension_name_short_description,
31-
useMOS: state.matlab.useMOS,
32-
useMRE: state.matlab.useMRE,
3331
authentication: state.authentication,
3432
matlab: {
3533
version: state.matlab.versionOnPath,

gui/src/test/utils/state.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ const state = {
4242
versionOnPath: 'R2023b',
4343
supportedVersions: ['R2020b', 'R2023b'],
4444
busyStatus: 'idle',
45-
useMOS: false,
46-
useMRE: false
4745
},
4846
authentication: {
4947
enabled: false,

matlab_proxy/app.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020-2024 The MathWorks, Inc.
1+
# Copyright 2020-2025 The MathWorks, Inc.
22

33
import asyncio
44
import json
@@ -197,8 +197,6 @@ async def get_env_config(req):
197197
state = req.app["state"]
198198
config = state.settings["env_config"]
199199

200-
config["useMOS"] = mwi_env.Experimental.should_use_mos_html()
201-
config["useMRE"] = mwi_env.Experimental.should_use_mre_html()
202200
config["isConcurrencyEnabled"] = IS_CONCURRENCY_CHECK_ENABLED
203201
# In a previously authenticated session, if the url is accessed without the token(using session cookie), send the token as well.
204202
config["authentication"] = {

matlab_proxy/app_state.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -994,12 +994,11 @@ async def __setup_env_for_matlab(self) -> dict:
994994
# The mwi_logs_dir is where MATLAB will write any subsequent logs
995995
matlab_env["MATLAB_LOG_DIR"] = str(self.mwi_logs_dir)
996996

997-
# Set MW_CONNECTOR_CONTEXT_ROOT for MPA
998-
if mwi_env.Experimental.is_mpa_enabled():
999-
matlab_env["MW_CONNECTOR_CONTEXT_ROOT"] = self.settings.get("base_url", "/")
1000-
logger.info(
1001-
f"MW_CONNECTOR_CONTEXT_ROOT is set to: {matlab_env['MW_CONNECTOR_CONTEXT_ROOT']}"
1002-
)
997+
# Set MW_CONNECTOR_CONTEXT_ROOT
998+
matlab_env["MW_CONNECTOR_CONTEXT_ROOT"] = self.settings.get("base_url", "/")
999+
logger.info(
1000+
f"MW_CONNECTOR_CONTEXT_ROOT is set to: {matlab_env['MW_CONNECTOR_CONTEXT_ROOT']}"
1001+
)
10031002

10041003
# Setup Simulink Online which requires a pre-warm stage
10051004
if mwi_env.Experimental.is_simulink_enabled():

matlab_proxy/constants.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023-2024 The MathWorks, Inc.
1+
# Copyright 2023-2025 The MathWorks, Inc.
22
from typing import Final, List
33

44
"""This module defines project-level constants"""
@@ -24,6 +24,7 @@
2424
"R2023b",
2525
"R2024a",
2626
"R2024b",
27+
"R2025a",
2728
]
2829

2930
# This constant when set to True restricts the number of active sessions to one

matlab_proxy/matlab/startup.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
% Copyright 2020-2024 The MathWorks, Inc.
1+
% Copyright 2020-2025 The MathWorks, Inc.
22

3-
if (strlength(getenv('MWI_BASE_URL')) > 0)
4-
connector.internal.setConfig('contextRoot', getenv('MWI_BASE_URL'));
5-
end
63
evalc('connector.internal.Worker.start');
74

85
% Add-on explorer is not supported in this environment.

matlab_proxy/settings.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -674,12 +674,6 @@ def _get_matlab_cmd(matlab_executable_path, code_to_execute, nlm_conn_str):
674674
if system.is_windows():
675675
flag_to_hide_desktop.extend(["-noDisplayDesktop", "-wait", "-log"])
676676

677-
mpa_flags = (
678-
mwi_env.Experimental.get_mpa_flags()
679-
if mwi_env.Experimental.is_mpa_enabled()
680-
else ""
681-
)
682-
683677
profile_matlab_startup = (
684678
"-timing" if mwi_env.Experimental.is_matlab_startup_profiling_enabled() else ""
685679
)
@@ -691,7 +685,7 @@ def _get_matlab_cmd(matlab_executable_path, code_to_execute, nlm_conn_str):
691685
"-softwareopengl",
692686
# " v=mvm ",
693687
*matlab_lic_mode,
694-
*mpa_flags,
688+
"-externalUI",
695689
profile_matlab_startup,
696690
"-r",
697691
code_to_execute,

0 commit comments

Comments
 (0)