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

[Examples] Build update #5334

Merged
merged 19 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ jobs:
node-version: 16.x
- name: Install dependencies
run: npm ci
- name: Build PlayCanvas (ES6-only)
run: npm run build:es6
- name: Build PlayCanvas (ES5-only)
run: npm run build:es5
- name: Build PlayCanvas Extras
run: npm run build:extras
- name: Build TypeScript declarations
run: npm run build:types
- name: Build Examples Browser
Expand Down
10 changes: 2 additions & 8 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,11 @@ example(canvas: HTMLCanvasElement, assets: {}, data: any) {
### Testing your example
Ensure you have a locally built version of the examples browser by running the commands in the `Local examples browser development` section. Then run `npm run serve` to serve the examples browser.

You can view the full collection of example iframes by visiting [http://localhost:5000/iframe/]() in your browser. Viewing the iframes individually like this allows you to rebuild and test your examples without having the rebuild the full examples browser.

Example files can be rebuilt using the `npm run build:iframes` command, which only rebuilds example code rather than the full application. You can also run the `npm run watch:iframes` command to rebuild these examples any time an example file is edited or the local playcanvas engine is rebuilt.

You can also provide the category and example name of a specific example you are editing to these commands as environment variables to speed up the rebuilding process. For example if you are editing the `./src/examples/misc/hello-world.tsx` example you can run the following command:
```
CATEGORY=misc EXAMPLE=hello-world npm run watch:iframes
You can view the full collection of example iframes by visiting [http://localhost:5000/iframe/]() in your browser.
```

### Debug and performance engine development
By default, the examples app uses the local version of the playcanvas engine located at `../build/playcanvas.js`. If you'd like to test the examples browser with the debug or performance versions of the engine instead, you can run `npm run watch:iframes:debug` or `npm run watch:iframes:profiler` commands.
By default, the examples app uses the local version of the playcanvas engine located at `../build/playcanvas.js`. If you'd like to test the examples browser with the debug or performance versions of the engine instead, you can run `npm run watch:debug` or `npm run watch:profiler` commands.

## Deployment

Expand Down