-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Start documenting package types * Describe App and ESM View types * Packages * Views, sources and templates * Link add command page * Link package types in index * Update docs/commands/add.md Co-authored-by: Sam Brown <sam.brown@jpmorgan.com> * Update docs/concepts/package-types.md Co-authored-by: Sam Brown <sam.brown@jpmorgan.com> * Update docs/concepts/package-types.md Co-authored-by: Sam Brown <sam.brown@jpmorgan.com> * Link esm-views section in add page * Update docs/commands/add.md Co-authored-by: Sam Brown <sam.brown@jpmorgan.com> * Link app section for more info * Update docs/concepts/package-types.md Co-authored-by: Sam Brown <sam.brown@jpmorgan.com> * Clarify manifest -> package.json + fix incorrect description * Add reasons why we don't support things * Disambiguate words * Phrase 'default export' concept better * Update docs/concepts/package-types.md Co-authored-by: Sam Brown <sam.brown@jpmorgan.com> * Update docs/concepts/package-types.md Co-authored-by: Sam Brown <sam.brown@jpmorgan.com> * Update docs/commands/add.md Co-authored-by: Sam Brown <sam.brown@jpmorgan.com> * Reword tricky sentence * Update docs/commands/add.md Co-authored-by: Sam Brown <sam.brown@jpmorgan.com> * Update docs/concepts/package-types.md Co-authored-by: Sam Brown <sam.brown@jpmorgan.com> * Split long sentence * Add all package types to configuration docs * Various typos * Split packge types and move template page * Fix links to package types and fix table layout * Slim down table * build/start/entrypoint/template sections * Fix configuration * Remove list of types in documentation Co-authored-by: Sam Brown <sam.brown@jpmorgan.com>
- Loading branch information
1 parent
2624def
commit aaaa5ee
Showing
13 changed files
with
542 additions
and
84 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
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
parent: Package Types | ||
nav_order: 10 | ||
title: app | ||
--- | ||
|
||
# App | ||
|
||
Modular `app`s are TypeScript and React-based Single Page Applications (SPAs) | ||
built with [Webpack v5](https://webpack.js.org/) (by default) or | ||
[esbuild](https://esbuild.github.io/) (by turning on `useModularEsbuild` in | ||
[the configuration](../configuration.md)). | ||
|
||
Apps support pretty much all the functionalities from | ||
[Create React App v5](https://create-react-app.dev/docs/custom-templates), with | ||
some important differences: | ||
|
||
- [ejecting](https://create-react-app.dev/docs/available-scripts/#npm-run-eject) | ||
is not supported. As an opinionated tool, Modular tries to offer an uniform | ||
way of building applications, although feedback on our build configuration is | ||
welcome! | ||
- [template support](../package-types/template.md) is integrated in the | ||
[`modular add`](../commands/add.md) command. Modular templates are not | ||
guaranteed to be compatible with CRA templates. | ||
- Source files are loaded with the more performant | ||
[`esbuild-loader`](https://github.com/privatenumber/esbuild-loader) in the | ||
Webpack configuration. For this reason, Babel plugins are not supported. | ||
- [Local proxies](https://create-react-app.dev/docs/proxying-api-requests-in-development/) | ||
are supported, but [esbuild mode](../configuration.md) doesn't support the | ||
`package.json` `proxy` field. The more flexible | ||
[manual proxy configration](https://create-react-app.dev/docs/proxying-api-requests-in-development/#configuring-the-proxy-manually) | ||
is supported in both Webpack and esbuild mode. | ||
|
||
## Build | ||
|
||
To [build](../commands/build.md) your app for deployment, run: | ||
|
||
```bash | ||
modular build my-app-name | ||
``` | ||
|
||
The resulting output is an optimized site that can be served statically. All | ||
code (files in `src` plus external dependencies required in the code) is bundled | ||
in a single blob of code that can be split in different files. | ||
|
||
## Start | ||
|
||
To run your app locally on a development server, run | ||
[start](../commands/start.md): | ||
|
||
```bash | ||
modular start my-app-name | ||
``` | ||
|
||
This causes a developer server to run on port 3000, serving the app with an | ||
additional runtime layer that provides developer experience functionalities like | ||
hot reloading and on-screen error overlay. | ||
|
||
## Entry-point | ||
|
||
Apps need an entry-point file located at `src/index.tsx`, which typically uses | ||
React to render components to the DOM, generated at `public/index.html`. | ||
|
||
## Template | ||
|
||
Apps are generated by `modular add` using the | ||
[`modular-template-app`](https://github.com/jpmorganchase/modular/tree/main/packages/modular-template-app) | ||
[template](./template.md). |
Oops, something went wrong.