zotero/scripts/config.js
Dan Stillman d9cee322cd Tag selector performance overhaul
- Use react-virtualized to render tags on demand, reducing the number
  of DOM elements from potentially tens of thousands to <100. This
  requires tags to be absolutely positioned, so sizing and
  positioning need to be precomputed rather than relying on CSS.
- Avoid unnecessary refreshes, speed up tag retrieval, and optimize
  sorting
- Debounce reflowing when resizing tag selector

Also:

- Scroll to top when changing collections
- Allow tags to take up full width of tag selector without truncation

Closes #1649
Closes #281
2019-03-28 06:28:34 -04:00

78 lines
1.9 KiB
JavaScript

// list of folders from where .js files are compiled and non-js files are symlinked
const dirs = [
'chrome',
'components',
'defaults',
'test',
'test/resource/chai',
'test/resource/chai-as-promised',
'test/resource/mocha'
];
// list of folders that are symlinked
const symlinkDirs = [
'chrome/content/zotero/xpcom/rdf',
'styles',
'translators'
];
// list of folders which are copied to the build folder
const copyDirs = [
'test/tests/data' // browser follows symlinks when loading test data
// triggering false-positive test results with mismatched URIs
];
// list of files from root folder to symlink
const symlinkFiles = [
'chrome.manifest',
'install.rdf',
// React needs to be patched by babel-worker.js, so symlink all files in resource/ except for
// those. Babel transpilation for React is still disabled in .babelrc.
'resource/**/*',
'!resource/react.js',
'!resource/react-dom.js',
'!resource/react-virtualized.js',
'update.rdf'
];
// these files will be browserified during the build
const browserifyConfigs = [
{
src: 'node_modules/sinon/lib/sinon.js',
dest: 'test/resource/sinon.js',
config: {
standalone: 'sinon'
}
},
{
src: 'node_modules/chai-as-promised/lib/chai-as-promised.js',
dest: 'test/resource/chai-as-promised.js',
config: {
standalone: 'chaiAsPromised'
}
}
];
// exclude mask used for js, copy, symlink and sass tasks
const ignoreMask = ['**/#*', '**/_*.scss'];
const jsFiles = [
`{${dirs.join(',')}}/**/*.js`,
`{${dirs.join(',')}}/**/*.jsx`,
`!{${symlinkDirs.concat(copyDirs).join(',')}}/**/*.js`,
`!{${symlinkDirs.concat(copyDirs).join(',')}}/**/*.jsx`,
// Special handling for React -- see note above
'resource/react.js',
'resource/react-dom.js',
'resource/react-virtualized.js',
];
const scssFiles = [
'scss/**/*.scss',
'chrome/skin/default/zotero/**/*.scss'
];
module.exports = {
dirs, symlinkDirs, copyDirs, symlinkFiles, browserifyConfigs, jsFiles, scssFiles, ignoreMask
};