Inclusion Criteria:
* Participants must have pathologically confirmed primary myelofibrosis according to WHO criteria or secondary myelofibrosis as defined by the IWG-MRT criteria.
* Intermediate-2/ high-risk disease as per Dynamic IPSS (DIPSS) criteria (Appendix G) OR
* Intermediate-1 risk disease with one of the following additional unfavorable features known to impact the survival adversely
* Red cell transfusion dependency
* Unfavorable Karyotype
* Platelet count ≤100 x 10\^9/L
* Presence of a high risk molecular marker associated with worsened overall survival (ASXL1, EZH2, IDH1/2, SRSF2, U2AF1, p53)
* Age 18-75
* Participants must be designated to undergo reduced intensity allogeneic peripheral blood (PB) or bone marrow (BM) hematopoietic stem cell transplantation. Consent will be obtained prior to admission for HCT.
* Participants who will undergo HCT from the following donor types are eligible:
* 6/6 (HLA-A, B, DR) fully matched related donor
* 8/8 (HLA-A, B, DR, C) fully matched unrelated donor. Matching in the unrelated setting must be at the allele level
* ECOG performance status ≤2 (Karnofsky ≥60%, see Appendix A)
* Life expectancy of greater than 3 months
* Able to give informed consent
* Off all MF-directed therapy at the time of enrollment, with the exception of ruxolitinib, one week or 4 half-lives (effective), whichever is longer, prior to the first dose of study treatment
* No allergy to ruxolitinib in the past
* For patients already receiving ruxolitinib at the time of enrollment, patients should be treated with ruxolitinib for a sufficient time to optimize spleen response or symptoms, at the discretion of the treating provider, prior to enrollment. Patients who have had prior splenectomy are eligible.
Exclusion Criteria:
* Prior history of progressive multifocal leukoencephalopathy (PML)
* Concomitant receipt of St. John's Wort
* Hypersensitivity to any JAK inhibitor, including ruxolitinib, fedratinib, or any other JAK inhibitor
* Prior allogeneic transplant for any hematopoietic disorder
* Had accelerated phase or leukemic transformation (≥10% blasts in PB or BM any time prior to HCT)
* Patients with uncontrolled infection (patients with stable controlled infections such as hepatitis B or HIV patients with undetectable viral load on antiviral treatment would be eligible). Patients who are actively ill and require hospitalization to treat an infection will be excluded.
* History of another malignancy within 5-years of date of enrollment except those who have received definitive treatment. Definitive treatment will be defined as the use of surgery, chemotherapy or radiation for the treatment of a malignancy, which susbsquently has no evidence of disease after 2 years or \<10% probably of recurrence after 1 year. In addition, patients with history of the following are eligible:
* basal cell or squamous cell carcinoma of skin
* Polycythemia Vera or Essential Thrombocythemia
* ductal carcinoma in situ (DCIS)
* superficial bladder cancer
* prostatic intraepithelial neoplasia (PIN)
* Patients without normal organ function defined as follows:
* AST (SGOT), ALT (SGPT) and Alkaline Phosphatase ≥ 3 × institutional Upper Limit of Normal (ULN)
* Direct bilirubin \>2.0 mg/dL
* Calculated creatinine clearance ≤60 mL/min (Cockcroft-Gault formula)
* Note: patients with CrCl ≤60 mL/min but with normal creatinine (within institutional normal ranges) and no other evidence of inadequate renal function are eligible.
* Have current or a history of congestive heart failure New York Heart Association (NYHA) class 3 or 4, or any history of documented diastolic or systolic dysfunction (LVEF \< 40%, as measured by MUGA scan or echocardiogram)
* Pregnancy at the time of enrollment
* Unable to give informed consent
* Have an uncontrolled intercurrent illness including, but not limited to, unstable angina pectoris, cardiac arrhythmia, or psychiatric illness/social situations that would limit compliance with study requirements.
* Not able to take oral medication