-
Notifications
You must be signed in to change notification settings - Fork 19
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
build: Add typescript support #703
base: master
Are you sure you want to change the base?
Conversation
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.
⛵
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.
A couple things:
- I'm a bit concerned at the amount of formatting/ESLint-type changes throughout the PR. Are these changes a potential code smell that the ESLint config isn't set up to support TypeScript (e.g., requiring a
.ts(x)
file extension on imports, splitting already reasonably short lines into multiple)? - The changes for TypeScript previously introduced in
@edx/frontend-build
v12.5.0 (installed in this PR). was since reverted in v12.6.2. As such, it feels risky to depend on v12.5.0 as when@edx/frontend-build
gets upgraded beyond v12.6.2, we'd lose the TS changes that are now reverted.- Note
@edx/frontend-build
is now getting installed with a^
, which means the installed version of the package might not actually match the explicit version defined in the package.json file (though it'll match the defined semantic version range). For example, runningnpm i
on your branch, I get v12.6.1 of@edx/frontend-build
installed despite^12.5.0
listed in the package.json file.
- Note
allRecommendations.length < 1 && | ||
samePartnerRecommendations.length < 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.
[curious] What is causing all these unnecessary splitting of lines into multiple lines throughout this file and PR? In many instances, the original lines are well under the max line length of 120 per the ESLint config specified in @edx/frontend-build
, but they are getting split into multiple lines? Not trying to be nitpicky on formatting, but these formatting changes feel a bit erroneous.
85d3812
to
67925e2
Compare
return `${ | ||
config.LMS_BASE_URL | ||
}/enterprise/grant_data_sharing_permissions/?${queryParams.toString()}`; | ||
} |
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.
nit: I realize many of the formatting changes like this one are generated by your use of Prettier; that said, I disagree with Prettier's opinion here. Changes like this to go from 1 to 3 lines is unnecessary given our ESLint config allows lines up to 120 characters.
67925e2
to
8785aa2
Compare
build: Use updated frontend-build typescript config chore: Merge from master and reconcile with new typescript lint config chore: Remove unnecessary typescript packages and fix tsconfig formatting
8785aa2
to
c9e8c26
Compare
@@ -45,7 +45,7 @@ FEATURE_ENABLE_AUTO_APPLIED_LICENSES='true' | |||
LEARNING_TYPE_FACET='true' | |||
LEARNER_SUPPORT_URL='https://support.edx.org/hc/en-us' | |||
FEATURE_ENABLE_PATHWAYS='true' | |||
FEATURE_ENABLE_COURSE_REVIEW='true' | |||
FEATURE_ENABLE_COURSE_REVIEW='' |
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.
[curious] Is this change intentional/necessary? Just wondering if changing this from true to false might cause confusion for the Markhors team who may expect the feature to be enabled locally.
@@ -99,7 +99,7 @@ const CourseHeader = () => { | |||
<Col xs={12} lg={12}> | |||
{catalog.containsContentItems ? ( | |||
<> | |||
{features.ENABLE_COURSE_REVIEW && <CourseReview />} | |||
{enableReviewSection && <CourseReview />} |
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.
This should be changed back to the original, relying on the feature flag.
// Only users buckted in `Variation 1` can see the change. | ||
const isExperimentVariation1 = isExperimentVariant(config.EXPERIMENT_2_ID, config.EXPERIMENT_2_VARIANT_1_ID); | ||
// For our experiment, we should trigger our Optimizely event only when this condition is true | ||
const triggerLicenseSubsidyEvent = shouldShowLicenseSubsidyPriceText; |
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 probably shouldn't be removing these? 🤔
@@ -36,40 +36,38 @@ const EnrollAction = ({ | |||
userEnrollment, | |||
subscriptionLicense, | |||
courseRunPrice, | |||
triggerLicenseSubsidyEvent, |
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 was this prop removed?
@@ -47,7 +42,6 @@ const ToDataSharingConsentPage = ({ enrollLabel, enrollmentUrl, triggerLicenseSu | |||
onClick={(e) => { | |||
analyticsHandler(e); | |||
optimizelyHandler(e); | |||
if (triggerLicenseSubsidyEvent) { optimizelyLicenseSubsidyHandler(e); } |
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.
[curious] Why is this logic getting removed?
const isShortLengthCourse = isShortCourse(course); | ||
|
||
const primaryPartnerLogo = getPrimaryPartnerLogo(partnerDetails); | ||
|
||
const handleCourseAboutPageVisitClick = useCourseAboutPageVisitClickHandler({ |
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 is this getting removed?
* | ||
* @returns Click handler function for course about page visit click events. | ||
*/ | ||
export const useCourseAboutPageVisitClickHandler = ({ href, courseKey, enterpriseId }) => { |
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 is this getting removed?
const content: string; | ||
export default content; | ||
} |
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.
nit: indenting is off.
return this.cachedAuthenticatedHttpClient.get(url); | ||
} | ||
|
||
fetchUserLicenseSubsidy(courseKey = this.activeCourseRun.key) { | ||
fetchUserLicenseSubsidy(courseKey = this?.activeCourseRun?.key) { |
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.
[curious] When would this
be undefined/null where it requires a ?
?
@@ -1,4 +1,5 @@ | |||
import React from 'react'; | |||
import isNumber from 'lodash.isnumber'; |
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.
Nice refactor to bring this library in.
Jira Ticket
This change adds build support for TypeScript, plus several files converted to TypeScript.
For all changes
Only if submitting a visual change