-
-
Notifications
You must be signed in to change notification settings - Fork 341
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Pedro Ferreira <10789765+apedroferreira@users.noreply.github.com> Co-authored-by: Bharat Kashyap <bharatkashyap@outlook.com>
- Loading branch information
1 parent
9a699e9
commit 9347e47
Showing
70 changed files
with
7,236 additions
and
1,015 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:18.10.0 as base | ||
FROM node:18.9.0 as base | ||
|
||
ARG GIT_SHA1 | ||
ENV GIT_SHA1=$GIT_SHA1 | ||
|
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,59 @@ | ||
# mui-toolpad-examples | ||
|
||
## To get started on the bundle size application | ||
|
||
```sh | ||
cd ./bundleSize | ||
yarn | ||
yarn dev | ||
``` | ||
|
||
## To start building an application | ||
|
||
### setup | ||
|
||
```sh | ||
mkdir my-app | ||
cd ./my-app | ||
yarn init --yes | ||
yarn add @mui/toolpad @mui/toolpad-core | ||
``` | ||
|
||
add the following scripts to package.json: | ||
|
||
```json | ||
"scripts": { | ||
"dev": "toolpad dev", | ||
"build": "toolpad build", | ||
"start": "toolpad start" | ||
} | ||
``` | ||
|
||
(TODO: replace above with a `npx @mui/toolpad init`?) | ||
|
||
run | ||
|
||
```sh | ||
yarn dev | ||
``` | ||
|
||
Go to the url that's printed | ||
|
||
### app building | ||
|
||
You'll see the trusted page editor. connections/components have been removed. | ||
|
||
#### Creating a custom component | ||
|
||
Go to the component drawer and click on "create new component". | ||
In your toolpad/components folder a new component will appear. you can edit in vscode. | ||
|
||
Known sharp edges: | ||
|
||
- close the toolpad component editor because it makes it interfere with the file system one. | ||
- do not rename the file, or at least not to something that doesn't start with a small letter, or contains spaces ot special characters. You'll see strange things happen. To be fixed | ||
- the code will be copied verbatim in the toolpad config. This is because that's currently exactly how this works. It's a hack and we'll come up with something proper once we are able to change low level things in Toolpad | ||
|
||
#### Connecting data | ||
|
||
You'll see you can only create two types of queries for now. Local function queries are defined inside of the `./toolpad/queries.ts` file. If you create a local function query, you'll see an editor where you can select one of the exported functions in `./toolpad/queries.ts` and bind parameters. there's a button that will open vscode for you to edit the queries file. In this file you can export any async function and it will appear in the query editor dropdown, click preview to run it and see its result. You can use environment variables here and import node modules. The result of the function will be brought to the page as bindable state. |
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,3 @@ | ||
node_modules | ||
.toolpad-generated | ||
.env |
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,20 @@ | ||
{ | ||
"name": "bundle-size", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"private": true, | ||
"scripts": { | ||
"dev": "toolpad dev", | ||
"build": "toolpad build", | ||
"start": "toolpad start" | ||
}, | ||
"dependencies": { | ||
"@mui/toolpad": "^0.0.41-alpha.1", | ||
"@mui/toolpad-core": "^0.0.41-alpha.1", | ||
"axios": "^1.3.3" | ||
}, | ||
"engines": { | ||
"node": "^16.17.0" | ||
} | ||
} |
Oops, something went wrong.