Skip to content

Commit

Permalink
Remove react and add preact (adobe#13608)
Browse files Browse the repository at this point in the history
* Add Preact library

* Change react to preact

* Fix problems caused by replacing react with preact

* Add Preact test utils and dependencies

* Change requires from react to preact in FileTreeView-test

* Fix problems caused by replacing react test utils with preact test utils

* Remove react

* Make findRenderedDOMComponentWithTag function as helper function

* Find and Replace react with preact

* Make preact, preact-compat, preact-test-utils as node_modules

* Change preact-compat dependency to point to adobe's fork
  • Loading branch information
boopeshmahendran authored and swmitra committed Aug 29, 2017
1 parent 9281909 commit c0c1b67
Show file tree
Hide file tree
Showing 13 changed files with 227 additions and 20,904 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ Thumbs.db
# ignore files copied from node_modules to src/thirdparty
/src/thirdparty/CodeMirror
/src/thirdparty/less.min.js
/src/thirdparty/preact
/src/thirdparty/preact-compat
/src/thirdparty/preact-test-utils
/src/thirdparty/simulate-event
/src/thirdparty/xtend

# ignore compiled files
/dist
Expand Down
30 changes: 29 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,41 @@ module.exports = function (grunt) {
'less/dist/less.min.js'
]
},
{
expand: true,
flatten: true,
dest: 'src/thirdparty/preact-compat',
cwd: 'src/node_modules/preact-compat',
src: [
'dist/preact-compat.min.js'
]
},
{
expand: true,
flatten: true,
dest: 'src/thirdparty/simulate-event',
cwd: 'src/node_modules/simulate-event',
src: [
'simulate-event.js'
]
},
{
expand: true,
flatten: true,
dest: 'src/thirdparty/xtend',
cwd: 'src/node_modules/xtend',
src: [
'mutable.js',
'immutable.js'
]
},
{
expand: true,
dest: 'src/thirdparty/acorn',
cwd: 'src/node_modules/acorn',
src: [
'dist/{,*/}*'
]
]
}
]
}
Expand Down
8 changes: 4 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ require.config({
paths: {
"text" : "thirdparty/text/text",
"i18n" : "thirdparty/i18n/i18n",
"react" : "thirdparty/react",

// The file system implementation. Change this value to use different
// implementations (e.g. cloud-based storage).
"fileSystemImpl" : "filesystem/impls/appshell/AppshellFileSystem"
"fileSystemImpl" : "filesystem/impls/appshell/AppshellFileSystem",
"preact-compat" : "thirdparty/preact-compat/preact-compat.min",
"preact" : "thirdparty/preact/preact"
},
map: {
"*": {
"thirdparty/CodeMirror2": "thirdparty/CodeMirror",
"thirdparty/react": "react"
"thirdparty/CodeMirror2": "thirdparty/CodeMirror"
}
}
});
Expand Down
60 changes: 60 additions & 0 deletions src/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"dependencies": {
"acorn": "5.1.1",
"codemirror": "5.28.0",
"less": "2.7.2"
"less": "2.7.2",
"preact": "8.2.1",
"preact-test-utils": "0.1.3",
"preact-compat": "adobe/preact-compat"
}
}
Loading

0 comments on commit c0c1b67

Please sign in to comment.