Skip to content

Commit

Permalink
don't use the index file in mashroom-utils in the frontend because it…
Browse files Browse the repository at this point in the history
… would pull node.js modules
  • Loading branch information
nonblocking committed Dec 18, 2023
1 parent 890980c commit 6f3833a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
SourceCodeEditorField,
Button
} from '@mashroom/mashroom-portal-ui-commons';
import {messagingUtils} from '@mashroom/mashroom-utils';
import {containsWildcard} from '@mashroom/mashroom-utils/lib/messaging-utils';

import type {ReactNode} from 'react';
import type {MashroomPortalMessageBus} from '@mashroom/mashroom-portal/type-definitions';
Expand Down Expand Up @@ -42,7 +42,7 @@ export default class MessageBusSendForm extends PureComponent<Props> {

if (!topic || !topic.trim()) {
errors.topic = 'errorTopicMandatory';
} else if (messagingUtils.containsWildcard(topic)) {
} else if (containsWildcard(topic)) {
errors.topic = 'errorTopicWildcards';
} else if (topic.indexOf('/') === 0 || topic.lastIndexOf('/') === topic.length - 1) {
errors.topic = 'errorTopicSlash';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import {fileTypeUtils} from '@mashroom/mashroom-utils';
import {isES6Module} from '@mashroom/mashroom-utils/lib/file-type-utils';
import getClientServices from './client_services';

import type {
Expand All @@ -17,7 +17,7 @@ const loadJs = (path: string): Promise<void> => {
return new Promise((resolve, reject) => {
console.info('Loading JS resource: ', path);
const scriptElem = document.createElement('script');
if (fileTypeUtils.isES6Module(path)) {
if (isES6Module(path)) {
scriptElem.type = 'module';
}
scriptElem.src = path;
Expand Down

0 comments on commit 6f3833a

Please sign in to comment.