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

O3-908 - Combine meta and index #324

Merged
merged 21 commits into from
Feb 12, 2022
Merged

Conversation

FlorianRappl
Copy link
Contributor

Requirements

  • This PR has a title that briefly describes the work done, including the ticket number if there is a ticket.

For changes to apps

If applicable

  • My work includes tests, or is validated by existing tests.
  • I have updated the esm-framework mock to reflect any API changes I have made.

Summary

Contains a fix for O3-1022 and introduces the optimized bundle asset that merges in the entry module and additionally the bundle manifest. This provides the basis for the renewed offline mode with opt-in functionality.

The PR also contains the button that enables this functionality. The actual opt-in functionality is, however, not yet implemented (subsequent PR).

Screenshots

image

image

Related Issue

Other

Nothing.

Copy link
Member

@manuelroemer manuelroemer left a comment

Choose a reason for hiding this comment

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

Looks great!

@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2022

File size impact

Merging feature/offline-on-demand into master impact files as follow:

@openmrs/esm-devtools-app (+0.39%)
Files new size
packages/apps/esm-devtools-app/dist/217.js 322 kB (+855 B / +0.27%) ↗️
packages/apps/esm-devtools-app/dist/openmrs-esm-devtools-app.js 7.01 kB (+488 B / +7.48%) ↗️
Unmodified (3) 18.2 kB (0 B / +0%) 👻
Total (5) 347 kB (+1.34 kB / +0.39%) ↗️
@openmrs/esm-implementer-tools-app (+0.21%)
Files new size
packages/apps/esm-implementer-tools-app/dist/openmrs-esm-implementer-tools-app.js 10.4 kB (+2.48 kB / +31.42%) ↗️
packages/apps/esm-implementer-tools-app/dist/217.js 322 kB (+855 B / +0.27%) ↗️
Unmodified (15) 1.28 MB (0 B / +0%) 👻
Total (17) 1.61 MB (+3.33 kB / +0.21%) ↗️
@openmrs/esm-login-app (+0.22%)
Files new size
packages/apps/esm-login-app/dist/openmrs-esm-login-app.js 11.3 kB (+3.38 kB / +42.5%) ↗️
packages/apps/esm-login-app/dist/217.js 322 kB (+855 B / +0.27%) ↗️
packages/apps/esm-login-app/dist/574.js 847 B (+52 B / +6.54%) ↗️
Unmodified (25) 1.59 MB (0 B / +0%) 👻
Total (28) 1.93 MB (+4.29 kB / +0.22%) ↗️
@openmrs/esm-offline-tools-app (+6.81%)
Files new size
packages/apps/esm-offline-tools-app/dist/openmrs-esm-offline-tools-app.js 95.2 kB (+87.2 kB / +1088.87%) ↗️
packages/apps/esm-offline-tools-app/dist/610.js 83.2 kB 👶
packages/apps/esm-offline-tools-app/dist/217.js 322 kB (+855 B / +0.27%) ↗️
packages/apps/esm-offline-tools-app/dist/851.js 87.2 kB (+151 B / +0.17%) ↗️
packages/apps/esm-offline-tools-app/dist/574.js 2.12 kB (+31 B / +1.48%) ↗️
packages/apps/esm-offline-tools-app/dist/469.js 107 kB (-4 B / -0%) ↘️
packages/apps/esm-offline-tools-app/dist/236.js 1.34 kB (0 B / +0%) 👻
Unmodified (19) 1.99 MB (0 B / +0%) 👻
Total (26) 2.69 MB (+171 kB / +6.81%) ↗️
@openmrs/esm-primary-navigation-app (+0.18%)
Files new size
packages/apps/esm-primary-navigation-app/dist/openmrs-esm-primary-navigation-app.js 10.8 kB (+2.79 kB / +34.76%) ↗️
packages/apps/esm-primary-navigation-app/dist/217.js 322 kB (+855 B / +0.27%) ↗️
packages/apps/esm-primary-navigation-app/dist/692.js 318 kB (+2 B / +0%) ↗️
Unmodified (15) 1.41 MB (0 B / +0%) 👻
Total (18) 2.06 MB (+3.65 kB / +0.18%) ↗️
@openmrs/esm-app-shell (+0.1%)
Files new size
packages/shell/esm-app-shell/dist/openmrs.js 1.33 MB (+1.42 kB / +0.11%) ↗️
packages/shell/esm-app-shell/dist/service-worker.js 163 kB (+637 B / +0.39%) ↗️
Unmodified (2) 538 kB (0 B / +0%) 👻
Total (4) 2.03 MB (+2.05 kB / +0.1%) ↗️
Generated by @jsenv/file-size-impact during Report bundle size#1832065207 on ec82c1c

@github-actions
Copy link
Contributor


Error: Error while trying to collect info after merging feature/offline-on-demand into master.

Error: Command failed: npx lerna run build
lerna notice cli v3.22.1
lerna info ci enabled
lerna info Executing command in 19 packages: "yarn run build"
lerna info run Ran npm script 'build' in '@openmrs/esm-state' in 12.3s:
lerna info run Ran npm script 'build' in '@openmrs/esm-globals' in 12.7s:
lerna info run Ran npm script 'build' in '@openmrs/esm-utils' in 14.3s:
lerna info run Ran npm script 'build' in '@openmrs/esm-breadcrumbs' in 14.2s:
lerna info run Ran npm script 'build' in '@openmrs/esm-error-handling' in 12.9s:
lerna info run Ran npm script 'build' in '@openmrs/esm-config' in 14.3s:
lerna info run Ran npm script 'build' in '@openmrs/esm-api' in 10.7s:
lerna info run Ran npm script 'build' in '@openmrs/esm-extensions' in 10.2s:
lerna info run Ran npm script 'build' in '@openmrs/esm-react-utils' in 15.9s:
lerna info run Ran npm script 'build' in '@openmrs/esm-styleguide' in 133.0s:
lerna info run Ran npm script 'build' in '@openmrs/esm-offline' in 11.4s:
lerna info run Ran npm script 'build' in '@openmrs/esm-framework' in 18.7s:
lerna ERR! yarn run build exited 2 in '@openmrs/esm-implementer-tools-app'
lerna ERR! yarn run build stdout:
yarn run v1.22.17
$ webpack --mode=production
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

lerna ERR! yarn run build stderr:
[webpack-cli] �[31mFailed to load '/home/runner/work/openmrs-esm-core/openmrs-esm-core/packages/apps/esm-implementer-tools-app/webpack.config.js' config�[39m
[webpack-cli] �[31mError: Cannot find module './dist/utils/optimize'
Require stack:
- /home/runner/work/openmrs-esm-core/openmrs-esm-core/packages/tooling/openmrs/default-webpack-config.js
- /home/runner/work/openmrs-esm-core/openmrs-esm-core/packages/apps/esm-implementer-tools-app/webpack.config.js
- /home/runner/work/openmrs-esm-core/openmrs-esm-core/node_modules/webpack-cli/lib/webpack-cli.js
- /home/runner/work/openmrs-esm-core/openmrs-esm-core/node_modules/webpack-cli/lib/bootstrap.js
- /home/runner/work/openmrs-esm-core/openmrs-esm-core/node_modules/webpack-cli/bin/cli.js
- /home/runner/work/openmrs-esm-core/openmrs-esm-core/node_modules/@storybook/core/node_modules/webpack/bin/webpack.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object. (/home/runner/work/openmrs-esm-core/openmrs-esm-core/packages/tooling/openmrs/default-webpack-config.js:8:29)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/work/openmrs-esm-core/openmrs-esm-core/packages/tooling/openmrs/default-webpack-config.js',
    '/home/runner/work/openmrs-esm-core/openmrs-esm-core/packages/apps/esm-implementer-tools-app/webpack.config.js',
    '/home/runner/work/openmrs-esm-core/openmrs-esm-core/node_modules/webpack-cli/lib/webpack-cli.js',
    '/home/runner/work/openmrs-esm-core/openmrs-esm-core/node_modules/webpack-cli/lib/bootstrap.js',
    '/home/runner/work/openmrs-esm-core/openmrs-esm-core/node_modules/webpack-cli/bin/cli.js',
    '/home/runner/work/openmrs-esm-core/openmrs-esm-core/node_modules/@storybook/core/node_modules/webpack/bin/webpack.js'
  ]
}�[39m
error Command failed with exit code 2.

lerna ERR! yarn run build exited 2 in '@openmrs/esm-implementer-tools-app'
lerna WARN complete Waiting for 2 child processes to exit. CTRL-C to exit immediately.

    at ChildProcess.exithandler (node:child_process:397:12)
    at ChildProcess.emit (node:events:394:28)
    at maybeClose (node:internal/child_process:1067:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

Generated by @jsenv/file-size-impact during Report bundle size#1830485067 on 91bdbc6

@github-actions
Copy link
Contributor


Error: Error while trying to collect info after merging feature/offline-on-demand into master.

Error: Command failed: npx lerna run build
lerna notice cli v3.22.1
lerna info ci enabled
lerna info Executing command in 19 packages: "yarn run build"
lerna WARN ECYCLE Dependency cycles detected, you should fix these!
lerna WARN ECYCLE @openmrs/esm-devtools-app -> openmrs -> @openmrs/esm-app-shell -> @openmrs/esm-devtools-app
lerna WARN ECYCLE @openmrs/esm-implementer-tools-app -> (nested cycle: @openmrs/esm-devtools-app -> openmrs -> @openmrs/esm-app-shell -> @openmrs/esm-devtools-app) -> @openmrs/esm-implementer-tools-app
lerna WARN ECYCLE @openmrs/esm-login-app -> (nested cycle: @openmrs/esm-implementer-tools-app -> (nested cycle: @openmrs/esm-devtools-app -> openmrs -> @openmrs/esm-app-shell -> @openmrs/esm-devtools-app) -> @openmrs/esm-implementer-tools-app) -> @openmrs/esm-login-app
lerna WARN ECYCLE @openmrs/esm-offline-tools-app -> (nested cycle: @openmrs/esm-login-app -> (nested cycle: @openmrs/esm-implementer-tools-app -> (nested cycle: @openmrs/esm-devtools-app -> openmrs -> @openmrs/esm-app-shell -> @openmrs/esm-devtools-app) -> @openmrs/esm-implementer-tools-app) -> @openmrs/esm-login-app) -> @openmrs/esm-offline-tools-app
lerna WARN ECYCLE @openmrs/esm-primary-navigation-app -> (nested cycle: @openmrs/esm-offline-tools-app -> (nested cycle: @openmrs/esm-login-app -> (nested cycle: @openmrs/esm-implementer-tools-app -> (nested cycle: @openmrs/esm-devtools-app -> openmrs -> @openmrs/esm-app-shell -> @openmrs/esm-devtools-app) -> @openmrs/esm-implementer-tools-app) -> @openmrs/esm-login-app) -> @openmrs/esm-offline-tools-app) -> @openmrs/esm-primary-navigation-app
lerna WARN ECYCLE (nested cycle: @openmrs/esm-primary-navigation-app -> (nested cycle: @openmrs/esm-offline-tools-app -> (nested cycle: @openmrs/esm-login-app -> (nested cycle: @openmrs/esm-implementer-tools-app -> (nested cycle: @openmrs/esm-devtools-app -> openmrs -> @openmrs/esm-app-shell -> @openmrs/esm-devtools-app) -> @openmrs/esm-implementer-tools-app) -> @openmrs/esm-login-app) -> @openmrs/esm-offline-tools-app) -> @openmrs/esm-primary-navigation-app) -> (nested cycle: @openmrs/esm-primary-navigation-app -> (nested cycle: @openmrs/esm-offline-tools-app -> (nested cycle: @openmrs/esm-login-app -> (nested cycle: @openmrs/esm-implementer-tools-app -> (nested cycle: @openmrs/esm-devtools-app -> openmrs -> @openmrs/esm-app-shell -> @openmrs/esm-devtools-app) -> @openmrs/esm-implementer-tools-app) -> @openmrs/esm-login-app) -> @openmrs/esm-offline-tools-app) -> @openmrs/esm-primary-navigation-app)
lerna info run Ran npm script 'build' in '@openmrs/esm-state' in 9.0s:
lerna info run Ran npm script 'build' in '@openmrs/esm-globals' in 9.2s:
lerna info run Ran npm script 'build' in '@openmrs/esm-utils' in 10.3s:
lerna info run Ran npm script 'build' in '@openmrs/esm-breadcrumbs' in 10.8s:
lerna info run Ran npm script 'build' in '@openmrs/esm-error-handling' in 10.2s:
lerna info run Ran npm script 'build' in '@openmrs/esm-config' in 10.9s:
lerna info run Ran npm script 'build' in '@openmrs/esm-api' in 7.9s:
lerna info run Ran npm script 'build' in '@openmrs/esm-extensions' in 7.3s:
lerna info run Ran npm script 'build' in '@openmrs/esm-react-utils' in 12.0s:
lerna info run Ran npm script 'build' in '@openmrs/esm-styleguide' in 93.2s:
lerna info run Ran npm script 'build' in '@openmrs/esm-offline' in 8.2s:
lerna info run Ran npm script 'build' in '@openmrs/esm-framework' in 13.9s:
lerna ERR! yarn run build exited 2 in '@openmrs/esm-primary-navigation-app'
lerna ERR! yarn run build stdout:
yarn run v1.22.17
$ webpack --mode=production
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

lerna ERR! yarn run build stderr:
[webpack-cli] �[31mFailed to load '/home/runner/work/openmrs-esm-core/openmrs-esm-core/packages/apps/esm-primary-navigation-app/webpack.config.js' config�[39m
[webpack-cli] �[31mError: Cannot find module './dist/utils/optimize'
Require stack:
- /home/runner/work/openmrs-esm-core/openmrs-esm-core/packages/tooling/openmrs/default-webpack-config.js
- /home/runner/work/openmrs-esm-core/openmrs-esm-core/packages/apps/esm-primary-navigation-app/webpack.config.js
- /home/runner/work/openmrs-esm-core/openmrs-esm-core/node_modules/webpack-cli/lib/webpack-cli.js
- /home/runner/work/openmrs-esm-core/openmrs-esm-core/node_modules/webpack-cli/lib/bootstrap.js
- /home/runner/work/openmrs-esm-core/openmrs-esm-core/node_modules/webpack-cli/bin/cli.js
- /home/runner/work/openmrs-esm-core/openmrs-esm-core/node_modules/@storybook/core/node_modules/webpack/bin/webpack.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object. (/home/runner/work/openmrs-esm-core/openmrs-esm-core/packages/tooling/openmrs/default-webpack-config.js:8:29)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/work/openmrs-esm-core/openmrs-esm-core/packages/tooling/openmrs/default-webpack-config.js',
    '/home/runner/work/openmrs-esm-core/openmrs-esm-core/packages/apps/esm-primary-navigation-app/webpack.config.js',
    '/home/runner/work/openmrs-esm-core/openmrs-esm-core/node_modules/webpack-cli/lib/webpack-cli.js',
    '/home/runner/work/openmrs-esm-core/openmrs-esm-core/node_modules/webpack-cli/lib/bootstrap.js',
    '/home/runner/work/openmrs-esm-core/openmrs-esm-core/node_modules/webpack-cli/bin/cli.js',
    '/home/runner/work/openmrs-esm-core/openmrs-esm-core/node_modules/@storybook/core/node_modules/webpack/bin/webpack.js'
  ]
}�[39m
error Command failed with exit code 2.

lerna ERR! yarn run build exited 2 in '@openmrs/esm-primary-navigation-app'
lerna WARN complete Waiting for 2 child processes to exit. CTRL-C to exit immediately.

    at ChildProcess.exithandler (node:child_process:397:12)
    at ChildProcess.emit (node:events:394:28)
    at maybeClose (node:internal/child_process:1067:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

Generated by @jsenv/file-size-impact during Report bundle size#1830524681 on 8b26912

@FlorianRappl FlorianRappl merged commit 98a6c6b into master Feb 12, 2022
@FlorianRappl FlorianRappl deleted the feature/offline-on-demand branch February 12, 2022 00:13
@brandones
Copy link
Collaborator

Looks great, thanks for this!

@ZacButko ZacButko mentioned this pull request May 3, 2022
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