Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix IE11 support and duplicate helpers by adding new Rollup config (#274
) * Replace microbundle build with custom Rollup config This reduces deduplication while microbundle sort their issues out. * Fix duplicate helpers by integrating TS output * Add Sail CI config * Remove bundlesize I just can't make it work, so good bye * Disable codecov comments * Update README badges * Disable codecov/patch status
- Loading branch information
Showing
10 changed files
with
465 additions
and
1,974 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
comment: off | ||
coverage: | ||
status: | ||
project: yes | ||
patch: no | ||
changes: no |
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,44 @@ | ||
workflow: | ||
- install | ||
- sail:parallel: | ||
- build | ||
- lint | ||
- test | ||
- e2e | ||
tasks: | ||
install: | ||
image: node:10 | ||
command: | ||
- yarn | ||
args: | ||
- install | ||
- --frozen-lockfile | ||
lint: | ||
image: node:10 | ||
command: | ||
- yarn | ||
args: | ||
- lint | ||
test: | ||
image: node:10 | ||
env: | ||
- CODECOV_TOKEN | ||
command: | ||
- yarn | ||
args: | ||
- run | ||
- run-s | ||
- coverage | ||
- codecov | ||
build: | ||
image: node:10 | ||
command: | ||
- yarn | ||
args: | ||
- build | ||
e2e: | ||
image: cypress/browsers:node10.2.1-chrome74 | ||
command: | ||
- bash | ||
args: | ||
- ./scripts/run-e2e.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules | ||
.build | ||
lib | ||
cypress/videos |
Binary file removed
BIN
-99 KB
examples/2-using-subscriptions/cypress/videos/integration.spec.js.mp4
Binary file not shown.
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,179 @@ | ||
import { DEFAULT_EXTENSIONS } from '@babel/core'; | ||
import commonjs from 'rollup-plugin-commonjs'; | ||
import nodeResolve from 'rollup-plugin-node-resolve'; | ||
import typescript from 'rollup-plugin-typescript2'; | ||
import buble from 'rollup-plugin-buble'; | ||
import babel from 'rollup-plugin-babel'; | ||
import { terser } from 'rollup-plugin-terser'; | ||
|
||
const pkgInfo = require('./package.json'); | ||
const external = ['dns', 'fs', 'path', 'url']; | ||
|
||
if (pkgInfo.peerDependencies) { | ||
external.push(...Object.keys(pkgInfo.peerDependencies)); | ||
} | ||
|
||
if (pkgInfo.dependencies) { | ||
external.push(...Object.keys(pkgInfo.dependencies)); | ||
} | ||
|
||
const externalPredicate = new RegExp(`^(${external.join('|')})($|/)`); | ||
const externalTest = id => { | ||
if (id === 'babel-plugin-transform-async-to-promises/helpers') { | ||
return false; | ||
} | ||
|
||
return externalPredicate.test(id); | ||
}; | ||
|
||
const terserPretty = terser({ | ||
sourcemap: true, | ||
warnings: true, | ||
ecma: 5, | ||
keep_fnames: true, | ||
ie8: false, | ||
compress: { | ||
pure_getters: true, | ||
toplevel: true, | ||
booleans_as_integers: false, | ||
keep_fnames: true, | ||
keep_fargs: true, | ||
if_return: false, | ||
ie8: false, | ||
sequences: false, | ||
loops: false, | ||
conditionals: false, | ||
join_vars: false | ||
}, | ||
mangle: false, | ||
output: { | ||
beautify: true, | ||
braces: true, | ||
indent_level: 2 | ||
} | ||
}); | ||
|
||
const terserMinified = terser({ | ||
sourcemap: true, | ||
warnings: true, | ||
ecma: 5, | ||
ie8: false, | ||
toplevel: true, | ||
compress: { | ||
keep_infinity: true, | ||
pure_getters: true, | ||
passes: 10 | ||
}, | ||
output: { | ||
comments: false | ||
} | ||
}); | ||
|
||
const plugins = [ | ||
nodeResolve({ | ||
mainFields: ['module', 'jsnext', 'main'], | ||
browser: true | ||
}), | ||
commonjs({ | ||
ignoreGlobal: true, | ||
include: /\/node_modules\//, | ||
namedExports: { | ||
'react': Object.keys(require('react')) | ||
}, | ||
}), | ||
typescript({ | ||
typescript: require('typescript'), | ||
cacheRoot: './node_modules/.cache/.rts2_cache', | ||
tsconfigDefaults: { | ||
compilerOptions: { | ||
sourceMap: true, | ||
declaration: true | ||
}, | ||
}, | ||
tsconfigOverride: { | ||
compilerOptions: { | ||
target: 'es6', | ||
}, | ||
}, | ||
}), | ||
buble({ | ||
transforms: { | ||
unicodeRegExp: false, | ||
dangerousForOf: true, | ||
dangerousTaggedTemplateString: true | ||
}, | ||
objectAssign: 'Object.assign', | ||
exclude: 'node_modules/**' | ||
}), | ||
babel({ | ||
babelrc: false, | ||
extensions: [...DEFAULT_EXTENSIONS, 'ts', 'tsx'], | ||
exclude: 'node_modules/**', | ||
presets: [], | ||
plugins: [ | ||
['babel-plugin-closure-elimination', {}], | ||
['@babel/plugin-transform-object-assign', {}], | ||
['@babel/plugin-transform-react-jsx', { | ||
pragma: 'React.createElement', | ||
pragmaFrag: 'React.Fragment', | ||
useBuiltIns: true | ||
}], | ||
['babel-plugin-transform-async-to-promises', { | ||
inlineHelpers: true, | ||
externalHelpers: true | ||
}] | ||
] | ||
}) | ||
]; | ||
|
||
const config = { | ||
input: './src/index.ts', | ||
external: externalTest, | ||
treeshake: { | ||
propertyReadSideEffects: false | ||
} | ||
}; | ||
|
||
export default [ | ||
{ | ||
...config, | ||
plugins: [...plugins, terserPretty], | ||
output: [ | ||
{ | ||
sourcemap: true, | ||
legacy: true, | ||
freeze: false, | ||
esModule: false, | ||
file: './dist/urql.js', | ||
format: 'cjs' | ||
}, | ||
{ | ||
sourcemap: true, | ||
legacy: true, | ||
freeze: false, | ||
esModule: false, | ||
file: './dist/urql.es.js', | ||
format: 'esm' | ||
} | ||
] | ||
}, { | ||
...config, | ||
plugins: [...plugins, terserMinified], | ||
output: [ | ||
{ | ||
sourcemap: true, | ||
legacy: true, | ||
freeze: false, | ||
file: './dist/urql.min.js', | ||
format: 'cjs' | ||
}, | ||
{ | ||
sourcemap: true, | ||
legacy: true, | ||
freeze: false, | ||
file: './dist/urql.es.min.js', | ||
format: 'esm' | ||
} | ||
] | ||
} | ||
]; |
Oops, something went wrong.