Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Remove react and add preact #13608

Merged
merged 12 commits into from
Aug 29, 2017
Merged

Conversation

boopeshmahendran
Copy link
Contributor

No description provided.

src/main.js Outdated

// The file system implementation. Change this value to use different
// implementations (e.g. cloud-based storage).
"fileSystemImpl" : "filesystem/impls/appshell/AppshellFileSystem"
},
packages: [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add preact as an node_module instead of inlining it to the thirdparty folder as we have been doing with new dependencies. (related to #12006)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@petetnt Actually react is being replaced with preact to remove facebook dependencies due to the PATENT issues. But preact-compat uses prop-types which is by facebook and we do not use proptypes in the FileTreeView code, so I removed it manually from preact-compat. So only we are inlining it to the thirdparty folder.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, wasn't aware that compat uses prop-types package as-is

@@ -31,8 +31,8 @@
define(function (require, exports, module) {
"use strict";

var React = require("thirdparty/react"),
ReactDOM = require("thirdparty/react-dom"),
var React = require("thirdparty/preact"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should just find-and-replace all the React and ReactDOM mentions to Preact

_ = require("thirdparty/lodash");

// Preact Test Utils doesn't have findRenderedDOMComponentWithTag method
// So create it
RTU.findRenderedDOMComponentWithTag = function(root, tagName) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of extending the RTU object can we just add findRenderedDOMComponentWithTag as a helper method?

function findRenderedDOMComponentWithTag(root, tagName) { ... }

...

findRenderedDOMComponentWithTag(...,...)

Just in case findRenderedDOMComponentWithTag gets added to RTU in future

@petetnt
Copy link
Collaborator

petetnt commented Aug 14, 2017

Nice work @boopeshmahendran!

@boopeshmahendran
Copy link
Contributor Author

@petetnt Thanks for reviewing. I'll address these comments.

@swmitra
Copy link
Collaborator

swmitra commented Aug 29, 2017

I would really like to highlight the fact that @petetnt had actually suggested to use preact which resulted in minimal code changes. Great work @petetnt and @boopeshmahendran 👍 .
Merging this PR now. Checked unit tests and ran smoke tests.

@swmitra swmitra merged commit c0c1b67 into adobe:master Aug 29, 2017
@ficristo
Copy link
Collaborator

ficristo commented Sep 4, 2017

https://github.com/mikaeljorhult/brackets-todo uses React through

var React = brackets.getModule('thirdparty/react');
var ReactDOM = brackets.getModule('thirdparty/react-dom');

with this PR it will be broken.

@petetnt
Copy link
Collaborator

petetnt commented Sep 4, 2017

@ficristo I can send a PR there later

@boopeshmahendran
Copy link
Contributor Author

@ficristo
Copy link
Collaborator

ficristo commented Sep 5, 2017

I was wondering if instead we should have handled this thing in core with some path mapping through RequireJS and possibly with some warnings.
If there isn't any way to remap / add warnings it should clearly noted in release notes this is a breaking change.

I noticed BracketsTODO is broken because I use it, but maybe there are other extensions.

If I remember correctly for other libs we use the path thirdparty/<lib name> why for preact is only preact-compat when use with brackets.getModule?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants