-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: lots of minor updates and modernification
- Loading branch information
Showing
16 changed files
with
373 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,3 @@ | ||
# dhis2-app-platform | ||
|
||
TODO | ||
|
||
- [x] Working POC | ||
- [x] Port a simple app (`usage-analytics`) to `app-scripts`/`app-shell` | ||
- [x] WORKING! | ||
- [/] Support app-specific dependencies | ||
- [ ] Enable pnp for appShell install (again) | ||
- [ ] Don't use CRA to build | ||
- [ ] Build app component bundles with WebPack (using SplitChunks for shared code) | ||
- [ ] Audit package sizes | ||
- [ ] Support simple configuration (`d2.config.js` or `.d2rc`) | ||
- [ ] Support specifying appShell for testing | ||
- [ ] Support automatic clearing of `.d2/shell` when new version installed (use prepublish script?) | ||
- [x] Support non-js app includes (images, static files, etc.) | ||
- [x] Reference React from appShell instead of bundling a second local version | ||
- [ ] ReactDOM too | ||
- [ ] Others? | ||
- [ ] Support bundle analysis | ||
- [ ] Name bundles based on application name | ||
- [ ] Support plugin entrypoint | ||
- [ ] Pass server URL to application component (or provide server context) | ||
- [x] Support i18n extract/generate/runtime | ||
- [ ] Add runtime dependencies (`d2-i18n`, `moment`) to `appShell` | ||
- [ ] Set locale in `appShell` | ||
- [x] Native jest testing support | ||
- [ ] Add `jest-enzyme` to `appShell` | ||
- [ ] Test independent of `appShell` | ||
- [ ] Support tests and mocks in application package | ||
- [ ] Native cypress testing support | ||
- [ ] Editor integrations | ||
- [ ] Prettier | ||
- [ ] ESLint? | ||
- [ ] tsconfig? | ||
- [ ] Enable pre-compiled appShell | ||
- [ ] Auto-install git hooks | ||
- [ ] `d2-app-scripts style apply` ? | ||
- [ ] `d2-app-scripts deploy`, `d2-app-scripts release`, `d2-app-scripts publish` ? | ||
- [ ] Do we need a `runtime` peer dependency? | ||
- [ ] Support static files in app builds | ||
- [ ] Generate app manifest, customize shell with app-provided data (name in headerbar, title) | ||
- [ ] Support SSR | ||
- [ ] Support `<Head></Head>` overrides in JSX | ||
- [ ] `appShell`-level router | ||
DOCUMENTATION TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "example-cra", | ||
"name": "simple-app", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"main": "src/App.js", | ||
"repository": "https://github.com/amcgee/dhis2-app-platform", | ||
"author": "Austin McGee <[email protected]>", | ||
"license": "BSD-3-Clause", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
import React from 'react'; | ||
import React from 'react' | ||
import HeaderBar from '@dhis2/ui/widgets/HeaderBar' | ||
|
||
// @ts-ignore | ||
const D2App = React.lazy(() => import('./current-d2-app/App')); // Automatic bundle splitting! | ||
// @ts-ignore | ||
const D2App = React.lazy(() => import('./current-d2-app/App')) // Automatic bundle splitting! | ||
|
||
const url = process.env.REACT_APP_DHIS2_BASE_URL; | ||
const url = process.env.REACT_APP_DHIS2_BASE_URL | ||
|
||
const App = () => ( | ||
<React.Suspense fallback={<div></div>}> | ||
<D2App config={{ | ||
url | ||
}} /> | ||
</React.Suspense> | ||
); | ||
<div> | ||
<HeaderBar appName={process.env.REACT_APP_DHIS2_APP_NAME} /> | ||
<React.Suspense fallback={<div />}> | ||
<D2App | ||
config={{ | ||
url, | ||
}} | ||
/> | ||
</React.Suspense> | ||
</div> | ||
) | ||
|
||
export default App; | ||
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './index.css'; | ||
import App from './App'; | ||
import * as serviceWorker from './serviceWorker'; | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import './index.css' | ||
import App from './App' | ||
import * as serviceWorker from './serviceWorker' | ||
|
||
import 'typeface-roboto/index.css' | ||
import '@dhis2/ui/defaults/reset.css' | ||
import '@dhis2/ui/defaults/common.css' | ||
// import '@dhis2/ui/defaults/reset.css' | ||
// import '@dhis2/ui/defaults/common.css' | ||
|
||
ReactDOM.render(<App />, document.getElementById('root')); | ||
ReactDOM.render(<App />, document.getElementById('root')) | ||
|
||
// If you want your app to work offline and load faster, you can change | ||
// unregister() to register() below. Note this comes with some pitfalls. | ||
// Learn more about service workers: http://bit.ly/CRA-PWA | ||
serviceWorker.unregister(); | ||
serviceWorker.unregister() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
/// <reference types="react-scripts" /> | ||
|
||
declare module '@dhis2/ui/widgets/HeaderBar' |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.