React Tag Selector polish, i18n and tests
- Added icon-button UI code for the menubutton - Upgrade to React 16 to allow non-standard attrs, such as `tooltiptext` to support XUL tooltips - Add i18n support for React UI elements - Update tests for reactified tag selector
This commit is contained in:
parent
897e74c7f1
commit
a24cada451
39 changed files with 1437 additions and 1252 deletions
|
@ -26,9 +26,14 @@ async function babelWorker(ev) {
|
|||
|
||||
try {
|
||||
let contents = await fs.readFile(sourcefile, 'utf8');
|
||||
if (sourcefile === 'resource/react-dom.js') {
|
||||
if (sourcefile === 'resource/react.js') {
|
||||
// patch react
|
||||
transformed = contents.replace(/ownerDocument\.createElement\((.*?)\)/gi, 'ownerDocument.createElementNS(DOMNamespaces.html, $1)')
|
||||
transformed = contents.replace('instanceof Error', '.constructor.name == "Error"')
|
||||
} else if (sourcefile === 'resource/react-dom.js') {
|
||||
// and react-dom
|
||||
transformed = contents.replace(/ ownerDocument\.createElement\((.*?)\)/gi, 'ownerDocument.createElementNS(HTML_NAMESPACE, $1)')
|
||||
.replace('element instanceof win.HTMLIFrameElement',
|
||||
'typeof element != "undefined" && element.tagName.toLowerCase() == "iframe"')
|
||||
.replace("isInputEventSupported = false", 'isInputEventSupported = true');
|
||||
} else if ('ignore' in options && options.ignore.some(ignoreGlob => multimatch(sourcefile, ignoreGlob).length)) {
|
||||
transformed = contents;
|
||||
|
|
|
@ -16,6 +16,7 @@ if (require.main === module) {
|
|||
const symlinks = symlinkFiles
|
||||
.concat(dirs.map(d => `${d}/**`))
|
||||
.concat([`!${formatDirsForMatcher(dirs)}/**/*.js`])
|
||||
.concat([`!${formatDirsForMatcher(dirs)}/**/*.jsx`])
|
||||
.concat([`!${formatDirsForMatcher(copyDirs)}/**`])
|
||||
|
||||
const signatures = await getSignatures();
|
||||
|
|
|
@ -4,7 +4,6 @@ const dirs = [
|
|||
'components',
|
||||
'defaults',
|
||||
'resource',
|
||||
'resource/web-library',
|
||||
'test',
|
||||
'test/resource/chai',
|
||||
'test/resource/chai-as-promised',
|
||||
|
|
|
@ -27,7 +27,7 @@ async function getJS(source, options, signatures) {
|
|||
var f;
|
||||
while ((f = matchingJSFiles.pop()) != null) {
|
||||
const newFileSignature = await getFileSignature(f);
|
||||
const dest = path.join('build', f);
|
||||
const dest = path.join('build', f.replace('.jsx', '.js'));
|
||||
f = path.normalize(f);
|
||||
if (f in signatures) {
|
||||
if (compareSignatures(newFileSignature, signatures[f])) {
|
||||
|
|
|
@ -28,7 +28,8 @@ async function getSass(source, options, signatures={}) {
|
|||
if (compareSignatures(newFileSignature, signatures[f])) {
|
||||
try {
|
||||
await fs.access(dest, fs.constants.F_OK);
|
||||
continue;
|
||||
// TODO: Doesn't recompile on partial scss file changes, so temporarily disabled
|
||||
// continue;
|
||||
} catch (_) {
|
||||
// file does not exists in build, fallback to browserifing
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ const source = [
|
|||
const symlinks = symlinkFiles
|
||||
.concat(dirs.map(d => `${d}/**`))
|
||||
.concat([`!${formatDirsForMatcher(dirs)}/**/*.js`])
|
||||
.concat([`!${formatDirsForMatcher(dirs)}/**/*.jsx`])
|
||||
.concat([`!${formatDirsForMatcher(copyDirs)}/**`]);
|
||||
|
||||
var signatures;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue