Skip to content

Commit

Permalink
Upgrade To THREE 0.166.0, upgrade to Expo SDK 51 (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
markrickert authored Jul 28, 2024
1 parent 91187fd commit 88dee7d
Show file tree
Hide file tree
Showing 52 changed files with 16,033 additions and 9,484 deletions.
12 changes: 0 additions & 12 deletions .eslintignore

This file was deleted.

60 changes: 56 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,57 @@
node_modules/**/*
secret/
/.expo
# OSX
#
.DS_Store

# VSCode
.vscode/
jsconfig.json

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IJ
#
.classpath
.cxx
.gradle
.idea
.project
.settings
local.properties
android.iml
android/app/libs
android/keystores/debug.keystore

# Cocoapods
#
example/ios/Pods

# Ruby
example/vendor/

# node.js
#
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log
build/

# Expo
.expo/*
32 changes: 12 additions & 20 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
.DS_Store
node_modules/
screenshots/
npm-debug.log
example/
secret/
*.tgz
babel.config.js
/src
/tsconfig.json
# Exclude all top-level hidden directories by convention
/.*/

.eslintignore
.eslintrc.js
.prettierrc
jest.config.js
example.js
app.json
# Exclude tarballs generated by `npm pack`
/*.tgz

/.expo
web-build
/.github/
/scripts
__mocks__
__tests__

/babel.config.js
/android/src/androidTest/
/android/src/test/
/android/build/
/example/
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,8 @@ All assets require a local URI to be loaded. You can resolve a local URI with `e
```ts
import { Asset } from 'expo-asset';

// Create an Asset from a resource
const asset = Asset.fromModule(require('./image.png'));

await asset.downloadAsync();

// This is the local URI
const uri = asset.localUri;
// Create an Asset from a local resource
const [{ localUri }] = await Asset.loadAsync(require('./image.png'));
```

### Loading a texture
Expand All @@ -143,11 +138,10 @@ import { TextureLoader } from 'three';
import { Asset } from 'expo-asset';

// Create an Asset from a resource
const asset = Asset.fromModule(require('./img.png'));
const [{ localUri }] = await Asset.loadAsync(require('./img.png'));

await asset.downloadAsync();
// This texture will be immediately ready but it'll load asynchronously
const texture = new TextureLoader().load(asset.localUri);
const texture = new TextureLoader().load(localUri);
```

### Loading an obj model
Expand All @@ -159,11 +153,10 @@ Be sure to add support for whatever model extension you wish to load to your `me
import { OBJLoader } from 'three/examples/jsm/loaders/OBJLoader';
import { Asset } from 'expo-asset';

const asset = Asset.fromModule(require('./model.obj'));
await asset.downloadAsync();
const [{ localUri }] = await Asset.loadAsync(require('./model.obj'));

const loader = new OBJLoader();
loader.load(asset.localUri, group => {
loader.load(localUri, group => {
// Model loaded...
});
```
Expand Down Expand Up @@ -390,6 +383,19 @@ THREE.suppressMetroWarnings();

---

## Running the example app

Clone the repo and `cd expo-three` then run:

```sh
yarn
yarn build
# CMD+C to exit build watch mode
cd example
npx expo prebuild
npx expo run:android # or npx expo run:ios
```

## ⛓ Links

Somewhat out of date
Expand Down
14 changes: 14 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"expo": {
"name": "expo-three",
"slug": "expo-three",
"version": "7.0.1",
"description": "Utilities for using THREE.js with Expo",
"sdkVersion": "50.0.0",
"platforms": [
"ios",
"android",
"web"
]
}
}
4 changes: 0 additions & 4 deletions example/.expo-shared/assets.json

This file was deleted.

38 changes: 32 additions & 6 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@
node_modules/**/*
.expo/*
npm-debug.*
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/
android/
ios/

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/
web-report/

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo
1 change: 0 additions & 1 deletion example/.watchmanconfig

This file was deleted.

104 changes: 0 additions & 104 deletions example/App.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions example/app.config.js

This file was deleted.

Loading

0 comments on commit 88dee7d

Please sign in to comment.