forked from react-native-netinfo/react-native-netinfo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add React Native Web support (react-native-netinfo#292 by @jaulz)
- Loading branch information
Showing
31 changed files
with
3,795 additions
and
201 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
* | ||
* @format | ||
*/ | ||
/* eslint-env jest */ | ||
|
||
const {device, expect, element, by} = require('detox'); | ||
|
||
|
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,15 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
/* eslint-env jest */ | ||
|
||
describe('NetInfo', () => { | ||
it('should have e2e tests in the future', async () => { | ||
await expect(true).toEqual(true); | ||
}); | ||
}); |
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
* | ||
* @format | ||
*/ | ||
/* eslint-env jest */ | ||
|
||
const {device, expect, element, by} = require('detox'); | ||
|
||
|
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,15 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
/* eslint-env jest */ | ||
|
||
describe('Fetch', () => { | ||
it('should have e2e tests in the future', async () => { | ||
await expect(true).toEqual(true); | ||
}); | ||
}); |
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
* | ||
* @format | ||
*/ | ||
/* eslint-env jest */ | ||
|
||
const {device, expect, element, by} = require('detox'); | ||
|
||
|
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,15 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
/* eslint-env jest */ | ||
|
||
describe('HookInitialValue', () => { | ||
it('should have e2e tests in the future', async () => { | ||
await expect(true).toEqual(true); | ||
}); | ||
}); |
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
* | ||
* @format | ||
*/ | ||
/* eslint-env jest */ | ||
|
||
const {device, expect, element, by} = require('detox'); | ||
|
||
|
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,15 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
/* eslint-env jest */ | ||
|
||
describe('EmitOnListen', () => { | ||
it('should have e2e tests in the future', async () => { | ||
await expect(true).toEqual(true); | ||
}); | ||
}); |
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,11 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>react-native-netinfo</title> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
* @flow | ||
*/ | ||
|
||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
const babelConfig = require('./../babel.config'); | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
|
||
module.exports = { | ||
entry: path.resolve(__dirname, 'index.tsx'), | ||
output: { | ||
path: path.resolve(__dirname, 'build'), | ||
filename: 'js/[name].bundle.js', | ||
}, | ||
target: 'web', | ||
mode: 'development', | ||
devtool: 'source-map', | ||
resolve: { | ||
modules: [ | ||
path.resolve(__dirname), | ||
path.resolve(__dirname, '..', 'node_modules'), | ||
], | ||
extensions: ['.web.tsx', '.tsx', '.web.ts', '.ts', '.web.js', '.js'], | ||
alias: { | ||
react: path.resolve(__dirname, '..', 'node_modules', 'react'), | ||
'react-native': path.resolve( | ||
__dirname, | ||
'..', | ||
'node_modules', | ||
'react-native-web', | ||
), | ||
}, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(ts|tsx)$/, | ||
loader: 'ts-loader', | ||
}, | ||
{ | ||
test: /\.m?js$/, | ||
use: { | ||
loader: 'babel-loader', | ||
options: babelConfig, | ||
}, | ||
}, | ||
{enforce: 'pre', test: /\.js$/, loader: 'source-map-loader'}, | ||
], | ||
}, | ||
plugins: [ | ||
new HtmlWebpackPlugin({template: path.resolve(__dirname, 'index.html')}), | ||
new webpack.HotModuleReplacementPlugin(), | ||
], | ||
}; | ||
/* | ||
module.exports = { | ||
context: __dirname, | ||
entry: { | ||
index: [ | ||
'react-native-webpack/clients/polyfills.js', | ||
`./index.tsx`, | ||
], | ||
}, | ||
devServer: { | ||
port: 8081, | ||
quiet: false, | ||
noInfo: true, | ||
lazy: true, | ||
filename: `[name].bundle`, | ||
watchOptions: { | ||
aggregateTimeout: 300, | ||
poll: 1000, | ||
}, | ||
publicPath: '/', | ||
stats: { colors: true }, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.tsx?$/, | ||
loader: 'ts-loader', | ||
exclude: /node_modules/, | ||
}, | ||
] | ||
}, | ||
resolve: { | ||
extensions: ['.web.tsx', ".tsx", '.web.ts', ".ts", '.web.js', ".js"] | ||
}, | ||
}; | ||
*/ |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.