Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: O3-310: Add an application-writable config.json file in frontends/ (attempt #2) #865

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brandones
Copy link
Collaborator

@brandones brandones commented Dec 28, 2023

Reverts #864

This restores @jnsereko 's #629.

Depends on openmrs/openmrs-module-spa#57 .

Sorry about the hasty work. Let's get this stuff in though.

Copy link
Contributor

Size Change: -41.2 kB (-1%)

Total Size: 2.72 MB

Filename Size Change
packages/apps/esm-implementer-tools-app/dist/727.js 0 B -32.9 kB (removed) 🏆
ℹ️ View Unchanged
Filename Size Change
packages/apps/esm-devtools-app/dist/630.js 1.76 kB 0 B
packages/apps/esm-devtools-app/dist/729.js 6.79 kB 0 B
packages/apps/esm-devtools-app/dist/735.js 2.63 kB 0 B
packages/apps/esm-devtools-app/dist/788.js 42.9 kB 0 B
packages/apps/esm-devtools-app/dist/875.js 9.76 kB 0 B
packages/apps/esm-devtools-app/dist/889.js 109 kB 0 B
packages/apps/esm-devtools-app/dist/961.js 25.3 kB 0 B
packages/apps/esm-devtools-app/dist/988.js 328 B 0 B
packages/apps/esm-devtools-app/dist/main.js 3.14 kB 0 B
packages/apps/esm-devtools-app/dist/openmrs-esm-devtools-app.js 3.18 kB 0 B
packages/apps/esm-implementer-tools-app/dist/319.js 761 B +128 B (+20%) 🚨
packages/apps/esm-implementer-tools-app/dist/329.js 10 kB 0 B
packages/apps/esm-implementer-tools-app/dist/426.js 1.66 kB 0 B
packages/apps/esm-implementer-tools-app/dist/460.js 865 B +130 B (+18%) ⚠️
packages/apps/esm-implementer-tools-app/dist/56.js 3.07 kB 0 B
packages/apps/esm-implementer-tools-app/dist/560.js 0 B -9.6 kB (removed) 🏆
packages/apps/esm-implementer-tools-app/dist/574.js 623 B +63 B (+11%) ⚠️
packages/apps/esm-implementer-tools-app/dist/587.js 2.81 kB 0 B
packages/apps/esm-implementer-tools-app/dist/620.js 126 kB 0 B
packages/apps/esm-implementer-tools-app/dist/625.js 679 B +117 B (+21%) 🚨
packages/apps/esm-implementer-tools-app/dist/638.js 9.74 kB 0 B
packages/apps/esm-implementer-tools-app/dist/651.js 6.86 kB 0 B
packages/apps/esm-implementer-tools-app/dist/735.js 2.63 kB 0 B
packages/apps/esm-implementer-tools-app/dist/738.js 6.79 kB 0 B
packages/apps/esm-implementer-tools-app/dist/739.js 33.8 kB 0 B
packages/apps/esm-implementer-tools-app/dist/757.js 676 B +116 B (+21%) 🚨
packages/apps/esm-implementer-tools-app/dist/788.js 42.9 kB 0 B
packages/apps/esm-implementer-tools-app/dist/807.js 675 B +116 B (+21%) 🚨
packages/apps/esm-implementer-tools-app/dist/833.js 805 B +124 B (+18%) ⚠️
packages/apps/esm-implementer-tools-app/dist/889.js 109 kB 0 B
packages/apps/esm-implementer-tools-app/dist/913.js 61.3 kB +142 B (0%)
packages/apps/esm-implementer-tools-app/dist/main.js 73.6 kB +301 B (0%)
packages/apps/esm-implementer-tools-app/dist/openmrs-esm-implementer-tools-app.js 3.3 kB -4 B (0%)
packages/apps/esm-login-app/dist/111.js 1.22 kB 0 B
packages/apps/esm-login-app/dist/126.js 2.5 kB 0 B
packages/apps/esm-login-app/dist/173.js 1.22 kB 0 B
packages/apps/esm-login-app/dist/224.js 256 B 0 B
packages/apps/esm-login-app/dist/236.js 272 B 0 B
packages/apps/esm-login-app/dist/240.js 364 B 0 B
packages/apps/esm-login-app/dist/272.js 264 B 0 B
packages/apps/esm-login-app/dist/319.js 692 B 0 B
packages/apps/esm-login-app/dist/336.js 234 B 0 B
packages/apps/esm-login-app/dist/370.js 30.6 kB 0 B
packages/apps/esm-login-app/dist/460.js 782 B 0 B
packages/apps/esm-login-app/dist/539.js 298 B 0 B
packages/apps/esm-login-app/dist/56.js 3.06 kB 0 B
packages/apps/esm-login-app/dist/574.js 609 B 0 B
packages/apps/esm-login-app/dist/625.js 600 B 0 B
packages/apps/esm-login-app/dist/627.js 257 B 0 B
packages/apps/esm-login-app/dist/63.js 16.5 kB 0 B
packages/apps/esm-login-app/dist/644.js 305 B 0 B
packages/apps/esm-login-app/dist/673.js 284 B 0 B
packages/apps/esm-login-app/dist/729.js 6.78 kB 0 B
packages/apps/esm-login-app/dist/735.js 2.63 kB 0 B
packages/apps/esm-login-app/dist/757.js 698 B 0 B
packages/apps/esm-login-app/dist/788.js 42.9 kB 0 B
packages/apps/esm-login-app/dist/807.js 961 B 0 B
packages/apps/esm-login-app/dist/812.js 22.5 kB 0 B
packages/apps/esm-login-app/dist/833.js 727 B 0 B
packages/apps/esm-login-app/dist/889.js 109 kB 0 B
packages/apps/esm-login-app/dist/main.js 57 kB 0 B
packages/apps/esm-login-app/dist/openmrs-esm-login-app.js 3.32 kB 0 B
packages/apps/esm-offline-tools-app/dist/102.js 81.3 kB 0 B
packages/apps/esm-offline-tools-app/dist/193.js 55 kB 0 B
packages/apps/esm-offline-tools-app/dist/319.js 1.14 kB 0 B
packages/apps/esm-offline-tools-app/dist/460.js 1.32 kB 0 B
packages/apps/esm-offline-tools-app/dist/56.js 3.07 kB 0 B
packages/apps/esm-offline-tools-app/dist/574.js 1.04 kB 0 B
packages/apps/esm-offline-tools-app/dist/625.js 1.04 kB 0 B
packages/apps/esm-offline-tools-app/dist/63.js 16.5 kB 0 B
packages/apps/esm-offline-tools-app/dist/729.js 6.79 kB 0 B
packages/apps/esm-offline-tools-app/dist/735.js 2.63 kB 0 B
packages/apps/esm-offline-tools-app/dist/757.js 1.2 kB 0 B
packages/apps/esm-offline-tools-app/dist/788.js 42.9 kB 0 B
packages/apps/esm-offline-tools-app/dist/807.js 1.1 kB 0 B
packages/apps/esm-offline-tools-app/dist/833.js 1.22 kB 0 B
packages/apps/esm-offline-tools-app/dist/889.js 109 kB 0 B
packages/apps/esm-offline-tools-app/dist/main.js 136 kB 0 B
packages/apps/esm-offline-tools-app/dist/openmrs-esm-offline-tools-app.js 3.29 kB 0 B
packages/apps/esm-primary-navigation-app/dist/262.js 13.3 kB 0 B
packages/apps/esm-primary-navigation-app/dist/319.js 200 B 0 B
packages/apps/esm-primary-navigation-app/dist/460.js 217 B 0 B
packages/apps/esm-primary-navigation-app/dist/574.js 183 B 0 B
packages/apps/esm-primary-navigation-app/dist/625.js 184 B 0 B
packages/apps/esm-primary-navigation-app/dist/63.js 16.5 kB 0 B
packages/apps/esm-primary-navigation-app/dist/729.js 6.79 kB 0 B
packages/apps/esm-primary-navigation-app/dist/735.js 18.7 kB 0 B
packages/apps/esm-primary-navigation-app/dist/757.js 209 B 0 B
packages/apps/esm-primary-navigation-app/dist/788.js 42.9 kB 0 B
packages/apps/esm-primary-navigation-app/dist/807.js 235 B 0 B
packages/apps/esm-primary-navigation-app/dist/833.js 210 B 0 B
packages/apps/esm-primary-navigation-app/dist/889.js 109 kB 0 B
packages/apps/esm-primary-navigation-app/dist/960.js 2.64 kB 0 B
packages/apps/esm-primary-navigation-app/dist/main.js 33.7 kB 0 B
packages/apps/esm-primary-navigation-app/dist/openmrs-esm-primary-navigation-app.js 3.23 kB 0 B
packages/framework/esm-api/dist/openmrs-esm-api.js 10 kB 0 B
packages/framework/esm-breadcrumbs/dist/openmrs-esm-breadcrumbs.js 2.66 kB 0 B
packages/framework/esm-config/dist/openmrs-esm-module-config.js 7.87 kB 0 B
packages/framework/esm-dynamic-loading/dist/openmrs-esm-dynamic-loading.js 2.12 kB 0 B
packages/framework/esm-error-handling/dist/openmrs-esm-error-handling.js 894 B 0 B
packages/framework/esm-extensions/dist/openmrs-esm-extensions.js 8.05 kB 0 B
packages/framework/esm-feature-flags/dist/openmrs-esm-feature-flags.js 1.67 kB 0 B
packages/framework/esm-framework/dist/455.openmrs-esm-framework.js 4.57 kB 0 B
packages/framework/esm-framework/dist/530.openmrs-esm-framework.js 2.92 kB 0 B
packages/framework/esm-framework/dist/645.openmrs-esm-framework.js 9.31 kB 0 B
packages/framework/esm-framework/dist/655.openmrs-esm-framework.js 6.83 kB 0 B
packages/framework/esm-framework/dist/710.openmrs-esm-framework.js 6.48 kB 0 B
packages/framework/esm-framework/dist/735.openmrs-esm-framework.js 2.66 kB 0 B
packages/framework/esm-framework/dist/788.openmrs-esm-framework.js 42.9 kB 0 B
packages/framework/esm-framework/dist/openmrs-esm-framework.js 376 kB 0 B
packages/framework/esm-globals/dist/openmrs-esm-globals.js 756 B 0 B
packages/framework/esm-offline/dist/openmrs-esm-offline.js 34.4 kB 0 B
packages/framework/esm-react-utils/dist/openmrs-esm-react-utils.js 15.4 kB 0 B
packages/framework/esm-routes/dist/openmrs-esm-utils.js 1.46 kB 0 B
packages/framework/esm-state/dist/openmrs-esm-state.js 888 B 0 B
packages/framework/esm-styleguide/dist/openmrs-esm-styleguide.js 19.3 kB 0 B
packages/framework/esm-utils/dist/openmrs-esm-utils.js 11.2 kB 0 B
packages/shell/esm-app-shell/dist/08a99d285a4ddb28.js 6.45 kB 0 B
packages/shell/esm-app-shell/dist/695f23c4e6b3f009.js 1.58 kB 0 B
packages/shell/esm-app-shell/dist/b66a463116735f62.js 3.81 kB 0 B
packages/shell/esm-app-shell/dist/openmrs.be43ff12c06781fc.js 334 kB 0 B
packages/shell/esm-app-shell/dist/service-worker.js 60.5 kB 0 B
packages/tooling/openmrs/dist/cli.js 2.86 kB 0 B
packages/tooling/openmrs/dist/commands/assemble.js 2.4 kB 0 B
packages/tooling/openmrs/dist/commands/build.js 1.34 kB 0 B
packages/tooling/openmrs/dist/commands/debug.js 545 B 0 B
packages/tooling/openmrs/dist/commands/develop.js 1.86 kB 0 B
packages/tooling/openmrs/dist/commands/index.js 438 B 0 B
packages/tooling/openmrs/dist/commands/start.js 851 B 0 B
packages/tooling/openmrs/dist/index.js 517 B 0 B
packages/tooling/openmrs/dist/runner.js 637 B 0 B
packages/tooling/openmrs/dist/utils/config.js 728 B 0 B
packages/tooling/openmrs/dist/utils/debugger.js 528 B 0 B
packages/tooling/openmrs/dist/utils/dependencies.js 640 B 0 B
packages/tooling/openmrs/dist/utils/helpers.js 395 B 0 B
packages/tooling/openmrs/dist/utils/importmap.js 3.02 kB 0 B
packages/tooling/openmrs/dist/utils/index.js 444 B 0 B
packages/tooling/openmrs/dist/utils/logger.js 368 B 0 B
packages/tooling/openmrs/dist/utils/npmConfig.js 830 B 0 B
packages/tooling/openmrs/dist/utils/untar.js 722 B 0 B
packages/tooling/openmrs/dist/utils/variables.js 192 B 0 B
packages/tooling/openmrs/dist/utils/webpack.js 278 B 0 B
packages/tooling/webpack-config/dist/index.js 3.58 kB 0 B

compressed-size-action

@ibacher
Copy link
Member

ibacher commented Jan 11, 2024

This actually depends on openmrs/openmrs-module-webservices.rest#595, which is the active version of that PR.

Comment on lines +163 to +166
useMemo(async () => {
const dependencies = await initInstalledBackendModules();
setBackendDependencies(dependencies);
}, []);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a useEffect instead?

@@ -155,3 +156,21 @@ export async function checkModules(): Promise<Array<ResolvedDependenciesModule>>
export function hasInvalidDependencies(frontendModules: Array<ResolvedDependenciesModule>) {
return frontendModules.some((m) => m.dependencies.some((n) => n.type !== 'okay'));
}

export function useBackendDependencyCheck(moduleName: string) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rename the hook to something like: useBackendModuleExists(moduleName: string). What do you think of adding an optional parameter that validates the module versions:

export function useBackendModuleExists(moduleName: string, moduleVersion?: string) {}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with the rename, but don't complicate code for no reason. You can add that parameter when you need it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think we are going to need a version check for this to function properly. Regardless of which module the backend code for this goes into, it's only going to be available from the next version on, so it would be nice if isSpaModulePresent was actually based on not just the presence of the module, but the presence of at least a minimal version...

@ibacher ibacher force-pushed the main branch 2 times, most recently from 8f994a6 to 9cee659 Compare July 22, 2024 18:54
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.

3 participants