-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1598 from cozy/preact
feat: Remove preact
- Loading branch information
Showing
7 changed files
with
27 additions
and
63 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
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
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,17 +1,8 @@ | ||
let Portal | ||
if (process.env.USE_PREACT) { | ||
try { | ||
Portal = require('preact-portal') | ||
} catch (e) { | ||
// We need this try/catch for webpack not to error if preact-portal | ||
// is not found | ||
} | ||
} else { | ||
const ReactDOM = require('react-dom') | ||
Portal = ({ into, children }) => { | ||
const targetElement = document.querySelector(into) | ||
return ReactDOM.createPortal(children, targetElement) | ||
} | ||
import ReactDOM from 'react-dom' | ||
|
||
const Portal = ({ into, children }) => { | ||
const targetElement = document.querySelector(into) | ||
return ReactDOM.createPortal(children, targetElement) | ||
} | ||
|
||
export default Portal |
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,8 +1,3 @@ | ||
let defaultViewer | ||
if (process.env.USE_PREACT) { | ||
defaultViewer = '' | ||
} else { | ||
defaultViewer = require('./index').default | ||
} | ||
import DefaultViewer from './index' | ||
|
||
export default defaultViewer | ||
export default DefaultViewer |
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 |
---|---|---|
|
@@ -13757,16 +13757,6 @@ posthtml@^0.9.2: | |
posthtml-parser "^0.2.0" | ||
posthtml-render "^1.0.5" | ||
|
||
[email protected]: | ||
version "1.1.3" | ||
resolved "https://registry.yarnpkg.com/preact-portal/-/preact-portal-1.1.3.tgz#22cdd3ecf6ad9aaa3f830607a9c6591de90aedb7" | ||
integrity sha512-rE0KG2b7ggIly4VVsSm7+WmQmG/EoUZzBOed2IbycyaFIArOvz+yab/8RBoDogA0JWZuTsbMTStR41Ghc+5m7Q== | ||
|
||
[email protected]: | ||
version "8.4.2" | ||
resolved "https://registry.yarnpkg.com/preact/-/preact-8.4.2.tgz#1263b974a17d1ea80b66590e41ef786ced5d6a23" | ||
integrity sha512-TsINETWiisfB6RTk0wh3/mvxbGRvx+ljeBccZ4Z6MPFKgu/KFGyf2Bmw3Z/jlXhL5JlNKY6QAbA9PVyzIy9//A== | ||
|
||
prelude-ls@~1.1.2: | ||
version "1.1.2" | ||
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" | ||
|