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

Upgrade to Vue 3 and the Composition API #6

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .browserslistrc

This file was deleted.

14 changes: 14 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* eslint-env node */
require("@rushstack/eslint-patch/modern-module-resolution");

module.exports = {
root: true,
extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/eslint-config-prettier",
],
env: {
"vue/setup-compiler-macros": true,
},
};
14 changes: 0 additions & 14 deletions .eslintrc.js

This file was deleted.

29 changes: 18 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
.DS_Store
node_modules
/dist

# local env files
.env.local
.env.*.local

# Log files
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
*.sw?
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["johnsoncodehk.volar", "johnsoncodehk.vscode-typescript-vue-plugin"]
}
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vue-threejs-demo

This is a Proof-Of-Concept integration of Vue.js and Three.js. I have converted the Three.js [Trackball Control Example](https://threejs.org/examples/?q=cont#misc_controls_trackball) to a Vue/Vuex application and added some additional UI sugar on top.
This is a Proof-Of-Concept integration of Vue.js and Three.js. I have converted the Three.js [Trackball Control Example](https://threejs.org/examples/?q=cont#misc_controls_trackball) to a Vue/Vuex application and added some additional UI sugar on top.

[See the demo here](https://vuethree.stagerightlabs.com/)

Expand All @@ -9,19 +9,32 @@ This is a Proof-Of-Concept integration of Vue.js and Three.js. I have converte
npm install
```

### Compiles and hot-reloads for development
```
npm run serve
```
### Compile and Hot-Reload for Development

### Compiles and minifies for production
```sh
npm run dev
```

### Compile and Minify for Production

```sh
npm run build
```

### Lint with [ESLint](https://eslint.org/)

```sh
npm run lint
```

## Helpful Links

https://stackoverflow.com/questions/47849626/import-and-use-three-js-library-in-vue-component

https://www.reddit.com/r/vuejs/comments/7fdq9b/vue_and_threejs/

https://stackoverflow.com/questions/71083549/why-do-not-mutate-vuex-store-state-outside-mutation-handlers-error-shows-up

## Thanks

Special thanks to [@Camil88](https://github.com/Camil88) for sorting out some important reactivity issues. See here: https://github.com/stagerightlabs/Vue-Three-Demo/issues/5
3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: '3'

services:

node:
build:
context: docker/node
volumes:
- ./:/var/www:cached

dev:
build:
context: docker/node
volumes:
- ./:/var/www:cached
ports:
- 3000:3000
- 5050:5050
command: ['npm', 'run', 'dev']
7 changes: 7 additions & 0 deletions docker/node/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:16

LABEL maintainer="Ryan C. Durham <[email protected]>"

USER node

WORKDIR /var/www
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
18 changes: 0 additions & 18 deletions jest.config.js

This file was deleted.

Loading