-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hirad/Made cfd an independent monorepo #5036
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/deriv/deriv-app/HUpuAmoHZPxashLs7fosSXaKVYi1 |
A production App ID was automatically generated for this PR. (log)
Click here to copy & paste above information.
|
Please add CFD to |
packages/cfd/.travis.yml
Outdated
@@ -0,0 +1,11 @@ | |||
sudo: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't use travis anymore. It's safe to remove this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
packages/cfd/build/constants.js
Outdated
|
||
const ALIASES = { | ||
_common: path.resolve(__dirname, '../src/_common'), | ||
Assets: path.resolve(__dirname, '../src/Assets'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assets folder is not there in cfd/src
. I think we should remove it.
packages/cfd/globals.d.ts
Outdated
declare module '@deriv/bot-web-ui'; | ||
declare module '@deriv/cashier'; | ||
declare module '@deriv/components'; | ||
declare module '@deriv/dashboard'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dashboard is changed to appstore. Can you update it here?
@@ -95,6 +95,7 @@ | |||
"@deriv/bot-web-ui": "^1.0.0", | |||
"@deriv/cashier": "^1.0.0", | |||
"@deriv/components": "^1.0.0", | |||
"@deriv/cfd": "^1.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should also add cfd scope to build:travis
package command
@@ -1,5 +0,0 @@ | |||
import CFDDashboard from './Containers/cfd-dashboard'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the entire CFD folder in Modules?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already done but for some reason github shows it differently.
packages/cfd/package.json
Outdated
"@deriv/api-types": "1.0.48", | ||
"@deriv/components": "^1.0.0", | ||
"@deriv/deriv-api": "^1.0.8", | ||
"@deriv/deriv-charts": "^0.5.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deriv/deriv-charts is not needed in this package
packages/cfd/src/sass/app.scss
Outdated
// Components | ||
@import 'app/_common/components/amount'; | ||
@import 'app/_common/components/allow-equals'; | ||
//@import 'app/_common/components/calendar'; // TODO: [move-to-components] Calendar component should be moved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may remove the TODOs in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
{ | ||
path: routes.dxtrade, | ||
component: props => <CFD {...props} platform='dxtrade' />, | ||
// Don't use `Localize` component since native html tag like `option` cannot render them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can remove this to decrease duplication..
same for line 59.
packages/cfd/build/constants.js
Outdated
// new HtmlWebPackPlugin(htmlOutputConfig()), | ||
// new HtmlWebpackTagsPlugin(htmlInjectConfig()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we going to enable these plugins in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. I remove them in the my new commit.
<div> | ||
<Localize i18n_default_text='Loading...' /> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these divs necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since fallback is required in react suspense, we are using plain text to avoid further issues.
> | ||
<Switch> | ||
{getRoutesConfig({ is_dashboard }).map((route, idx) => ( | ||
<RouteWithSubRoutes key={idx} {...route} {...props} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<RouteWithSubRoutes key={idx} {...route} {...props} /> | |
<RouteWithSubRoutes key={idx} {...route} {...props} /> |
The key
should not use idx generated by map()
can we use something unique from the return of getRoutesConfig
packages/cfd/src/index.tsx
Outdated
@@ -0,0 +1,15 @@ | |||
// import 'babel-polyfill'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need commented import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remove it in my last commit.
… cfd-monorepo-package
…/deriv-app into cfd-monorepo-package
import { expect } from 'chai'; | ||
import { configure, shallow } from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-16'; | ||
import { RouteWithSubRoutesRender } from '../route-with-sub-routes.jsx'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess we can don’t use extension .jsx
import { RouteWithSubRoutesRender } from '../route-with-sub-routes.jsx'; | |
import { RouteWithSubRoutesRender } from '../route-with-sub-routes'; |
import { PlatformContext } from '@deriv/shared'; | ||
import { Localize } from '@deriv/translations'; | ||
import getRoutesConfig from '../../Constants/routes-config'; | ||
import RouteWithSubRoutes from './route-with-sub-routes.jsx'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import RouteWithSubRoutes from './route-with-sub-routes.jsx'; | |
import RouteWithSubRoutes from './route-with-sub-routes'; |
@@ -1,5 +1,5 @@ | |||
import React from 'react'; | |||
import SuccessDialog from 'App/Containers/Modals/success-dialog.jsx'; | |||
import SuccessDialog from 'Components/success-dialog.jsx'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import SuccessDialog from 'Components/success-dialog.jsx'; | |
import SuccessDialog from 'Components/success-dialog'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the suggested changes.
packages/cfd/build/config.js
Outdated
}, | ||
}); | ||
|
||
const htmlInjectConfig = () => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest removing htmlInjectConfig() because it's not used in packages/cfd/build/constants.js same like I was recommended to do it with trader package in my PR #5063 recently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please help to add the newly created Package to extract-string.js
file to make sure we pick up on the newly added strings and translate them.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, let's wait for more approvals...
Noticed there are conflicts on your PR.
Changes:
Please include a summary of the change and which issue is fixed below:
When you need to add unit test
When you need to add integration test
Test coverage checklist (for reviewer)
Type of change