Skip to content

Configuration for incorporating React components#2546

Merged
arikfr merged 5 commits into
getredash:masterfrom
washort:upstream-react
Jun 27, 2018
Merged

Configuration for incorporating React components#2546
arikfr merged 5 commits into
getredash:masterfrom
washort:upstream-react

Conversation

@washort

@washort washort commented May 17, 2018

Copy link
Copy Markdown

This provides the necessary parts for using React components in Angular templates.

The footer component is converted to React as a demonstration.

@washort
washort force-pushed the upstream-react branch 3 times, most recently from b4d3465 to 0ab2b15 Compare May 17, 2018 19:25
@jezdez

jezdez commented May 17, 2018

Copy link
Copy Markdown
Contributor

@arikfr Hey there, @washort has ported various other Angular components but I thought it would make sense to start small first and see if you have feedback for the general setup that we can incorporate now. In other words, I consider this to be the first step of many and would appreciate if you or someone else from the Redash team could take a look at it. Cheers!

@washort

washort commented May 18, 2018

Copy link
Copy Markdown
Author

I think the tests are failing due to the JS dependencies being different from master. Could a maintainer try CircleCI's "run without cache" option?

@arikfr

arikfr commented May 24, 2018

Copy link
Copy Markdown
Member

Actually I think it fails because of this:

redash/webpack.config.js

Lines 32 to 36 in a6bc7c0

// Currently `lodash` is used only by `gridstack.js`, but it can work
// with `underscore` as well, so set an alias to avoid bundling both `lodash` and
// `underscore`. When adding new libraries, check if they can work
// with `underscore`, otherwise remove this line
lodash: "underscore"

Looks like ngcomponent needs lodash, and underscore doesn't cut it anymore. I'm cool with replacing underscore with lodash (should've done it long ago). Any idea if it's a drop-in replacement?

@washort

washort commented May 24, 2018

Copy link
Copy Markdown
Author

Aha, and I didn't notice this because we haven't pulled that into our fork yet. Fixed.

@washort

washort commented May 24, 2018

Copy link
Copy Markdown
Author

Looks like there may not be any dependencies on underscore other than dev dependencies and the direct uses in redash. Would you want those underscore usages converted to lodash for this PR?

@arikfr

arikfr commented May 30, 2018

Copy link
Copy Markdown
Member

Looks like there may not be any dependencies on underscore other than dev dependencies and the direct uses in redash. Would you want those underscore usages converted to lodash for this PR?

It's only being used by nomnom which is a dependency of a dependency of a dependency of a library Plot.ly is using :) I'm not sure it affects the build, because it looks like code that isn't used in the client.

The only thing we should probably do in this pull request is remove our requirements of underscore and underscore.string from package.json.

@washort

washort commented May 30, 2018

Copy link
Copy Markdown
Author

There's still one use of numberFormat from underscore.string present, but that doesn't depend on the rest of underscore so I left it. The rest of the usages I converted to lodash.

@washort
washort force-pushed the upstream-react branch 5 times, most recently from 962205f to 7caf440 Compare June 5, 2018 04:03
@arikfr

arikfr commented Jun 6, 2018

Copy link
Copy Markdown
Member

@washort don't you need to commit an updated package-lock.json file?

@arikfr

arikfr commented Jun 6, 2018

Copy link
Copy Markdown
Member

@washort never mind -- I did it myself (& updated some new files to use lodash instead of underscore).

Just one last question: did you had the chance to do some performance tests? Any noticeable implication of including react in the project?

@washort

washort commented Jun 7, 2018

Copy link
Copy Markdown
Author

I had a look using Chrome's "Lighthouse" audit tool and load/render times look like they're no more than 5% slower.

@arikfr
arikfr merged commit fa6e2cc into getredash:master Jun 27, 2018
@arikfr

arikfr commented Jun 27, 2018

Copy link
Copy Markdown
Member

Merged. Let's get this party started. 🎉

@arikfr

arikfr commented Jun 27, 2018

Copy link
Copy Markdown
Member

@jezdez

jezdez commented Jun 27, 2018

Copy link
Copy Markdown
Contributor

@arikfr ZOMG thank you!! 😍

@arikfr

arikfr commented Jun 27, 2018

Copy link
Copy Markdown
Member

@jezdez me? Let's thank @washort who does the heavy lifting here :-)

@jezdez

jezdez commented Jun 27, 2018

Copy link
Copy Markdown
Contributor

@arikfr That's true!

@washort:

1462065207_wxvke

@arikfr arikfr mentioned this pull request Jul 26, 2018
3 tasks
@arikfr arikfr added the Frontend: React Frontend codebase migration to React label Nov 13, 2018
@arikfr arikfr mentioned this pull request Nov 13, 2018
@washort
washort deleted the upstream-react branch December 10, 2018 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Frontend: React Frontend codebase migration to React Frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants