refactor(with-nextjs): upgrade to sdk 37

This commit is contained in:
Cedric van Putten
2020-04-22 16:38:30 +02:00
parent 628f8c6120
commit c7fd84f23b
9 changed files with 49 additions and 11123 deletions

23
with-nextjs/.gitignore vendored Normal file
View File

@@ -0,0 +1,23 @@
# @generated: @expo/next-adapter@2.1.0
node_modules/**/*
.expo/*
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/
web-report/
# debug
yarn-debug.log*
yarn-error.log*
# macOS
.DS_Store
# misc
.DS_Store
.env*

View File

@@ -1,5 +1,10 @@
# [Next.js Example](https://www.nextjs.org/)
<p>
<!-- Web -->
<img alt="Supports Expo Web" longdesc="Supports Expo Web" src="https://img.shields.io/badge/web-4630EB.svg?style=flat-square&logo=GOOGLE-CHROME&labelColor=4285F4&logoColor=fff" />
</p>
Using Next.js with Expo will enable you to [server side render](https://nextjs.org/features/server-side-rendering) the web part of your Expo app. This demo shows you how to setup your universal application to use use advanced universal modules from the Expo SDK like Camera, Gestures, Permissions, etc... with the Next.js tool-chain!
> 🚨 SSR is an experimental feature with Expo so modules might not be fully optimized for Next.js. If you find bugs please report them on the [Expo repo](https://github.com/expo/expo/issues) or [expo-cli repo](https://github.com/expo/expo-cli/issues) with the `[nextjs]` tag in the title.
@@ -27,7 +32,6 @@ In this approach you would be using SSR for web in your universal project. This
### 🏁 New Commands
- **Starting web**
- 🚫 `expo start:web`
-`yarn next dev`

View File

@@ -2,7 +2,6 @@
"expo": {
"name": "with-nextjs",
"version": "1.0.0",
"orientation": "portrait",
"icon": "https://github.com/expo/expo/blob/master/templates/expo-template-blank/assets/icon.png?raw=true",
"splash": {
"image": "https://github.com/expo/expo/blob/master/templates/expo-template-blank/assets/splash.png?raw=true",

View File

@@ -1,4 +1,4 @@
// @generated: @expo/next-adapter@2.0.0-beta.7
// @generated: @expo/next-adapter@2.1.0
// Learn more: https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/guides/using-nextjs.md#shared-steps
module.exports = { presets: ['@expo/next-adapter/babel'] };

View File

@@ -1,28 +1,8 @@
// @generated: @expo/next-adapter@2.1.0
// Learn more: https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/guides/using-nextjs.md#withexpo
const { withExpo } = require('@expo/next-adapter');
const withImages = require('next-images');
const withFonts = require('next-fonts');
const withOffline = require('next-offline');
module.exports = withExpo(withOffline(withFonts(withImages({
projectRoot: __dirname,
workboxOpts: {
swDest: 'workbox-service-worker.js',
/* changing any value means you'll have to copy over all the defaults */
/* next-offline */
globPatterns: ['static/**/*'],
globDirectory: '.',
runtimeCaching: [
{
urlPattern: /^https?.*/,
handler: 'NetworkFirst',
options: {
cacheName: 'offlineCache',
expiration: {
maxEntries: 200,
},
},
},
],
},
}))));
module.exports = withExpo({
projectRoot: __dirname,
});

View File

@@ -1,25 +1,17 @@
{
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "next dev",
"eject": "expo eject"
},
"dependencies": {
"@expo/next-adapter": "^2.0.0-beta.7",
"expo": "^35.0.0",
"next": "^9.1.4",
"next-fonts": "^0.19.0",
"next-images": "^1.2.0",
"next-offline": "^4.0.6",
"react": "16.8.3",
"react-dom": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
"react-native-web": "^0.11.7"
"@expo/next-adapter": "2.1.0",
"expo": "37.0.7",
"next": "9.3.5",
"next-fonts": "1.0.3",
"next-images": "1.4.0",
"next-offline": "5.0.1",
"react": "16.9.0",
"react-dom": "16.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
"react-native-web": "0.11.7"
},
"devDependencies": {
"babel-preset-expo": "^7.1.0"
},
"private": true
"babel-preset-expo": "8.1.0"
}
}

View File

@@ -1,2 +1,2 @@
// @generated: @expo/next-adapter@2.0.0-beta.7
// @generated: @expo/next-adapter@2.1.0
export { default } from '@expo/next-adapter/document';

View File

@@ -1,4 +1,4 @@
// @generated: @expo/next-adapter@2.0.0-beta.7
// @generated: @expo/next-adapter@2.1.0
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';

File diff suppressed because it is too large Load Diff