Skip to content
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: migrate to typescript #296

Merged
merged 36 commits into from
Nov 20, 2019
Merged

Conversation

raveclassic
Copy link
Contributor

@raveclassic raveclassic commented Aug 8, 2019

Hi, guys!

So following mostjs/hold#36 this PR moves all the source entirely to typescript. There're a lot of changes and I thought although it would be hard to review everything in one time it would be even harder to migrate separately.

Some notes about the changes:

  • I tried to be as less invasive with the code as possible, only types were added. however there were some places (internally and mostly in tests) which relied for example on passing value to Sink#end method and so on - so I removed them
  • babel and its configuration was removed
  • mocha/nyc were updated to support typescript
  • resulting .d.ts files may be different from original most.d.ts although I tried my best to replicate everything. However I may have missed something.
  • I didn't touch perf tests as they seem a bit awkward to me because they contain dependencies on the packages which are not in package.json. If it's important I'll try once again to migrate them as well.

I don't expect this to be merged smooth but I'm looking forward to finding out all the problems and fixing them. I do love most and I would love to move this awesome library to the best static-typing solution.

@briancavalier
Copy link
Member

@raveclassic Thank you for this incredible undertaking! The core team discussed briefly today, and we are all supportive of the move to TS.

I should have time to start looking at this over the weekend.

Copy link
Member

@Frikki Frikki left a comment

Choose a reason for hiding this comment

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

A bit of a review.

.vscode/settings.json Outdated Show resolved Hide resolved
packages/core/src/Queue.ts Outdated Show resolved Hide resolved
packages/core/src/Queue.ts Outdated Show resolved Hide resolved
packages/core/src/combinator/combine.ts Outdated Show resolved Hide resolved
packages/core/src/combinator/combine.ts Outdated Show resolved Hide resolved
Copy link
Member

@briancavalier briancavalier left a comment

Choose a reason for hiding this comment

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

Sorry it's taken me longer to get started reviewing this than I thought. Thank you again for this work! I left a couple higher level items for discussion. I'll try to make incremental progress in reviewing over the next couple days.

packages/core/src/combinator/combine.ts Outdated Show resolved Hide resolved
packages/core/src/combinator/combine.ts Outdated Show resolved Hide resolved
packages/core/src/combinator/combine.ts Outdated Show resolved Hide resolved
packages/core/src/combinator/combine.ts Outdated Show resolved Hide resolved
packages/core/src/combinator/combine.ts Outdated Show resolved Hide resolved
packages/core/src/combinator/continueWith.ts Outdated Show resolved Hide resolved
packages/core/src/combinator/continueWith.ts Outdated Show resolved Hide resolved
Copy link
Member

@briancavalier briancavalier left a comment

Choose a reason for hiding this comment

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

Great progress. Let's keep this going! A few more comments as I work my may through.

packages/core/src/combinator/combine.ts Show resolved Hide resolved
packages/core/src/combinator/combine.ts Outdated Show resolved Hide resolved
packages/core/src/combinator/errors.ts Show resolved Hide resolved
packages/core/src/combinator/errors.ts Show resolved Hide resolved
packages/core/src/combinator/errors.ts Show resolved Hide resolved
packages/core/src/combinator/limit.ts Show resolved Hide resolved
packages/core/src/combinator/merge.ts Show resolved Hide resolved
packages/core/src/combinator/merge.ts Show resolved Hide resolved
packages/core/src/combinator/merge.ts Show resolved Hide resolved
Copy link
Member

@Frikki Frikki left a comment

Choose a reason for hiding this comment

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

Some more reviewed files.

packages/core/src/combinator/delay.ts Outdated Show resolved Hide resolved
packages/core/src/combinator/delay.ts Outdated Show resolved Hide resolved
packages/core/src/combinator/filter.ts Outdated Show resolved Hide resolved
packages/core/src/combinator/limit.ts Outdated Show resolved Hide resolved
packages/core/src/combinator/limit.ts Outdated Show resolved Hide resolved
packages/core/src/combinator/timeslice.ts Outdated Show resolved Hide resolved
packages/core/src/combinator/timeslice.ts Outdated Show resolved Hide resolved
packages/core/src/combinator/timeslice.ts Outdated Show resolved Hide resolved
packages/core/src/combinator/transform.ts Outdated Show resolved Hide resolved
packages/core/src/combinator/transform.ts Outdated Show resolved Hide resolved
Copy link
Member

@Frikki Frikki left a comment

Choose a reason for hiding this comment

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

25% reviewed. Phew!!!

packages/core/src/combinator/switch.ts Show resolved Hide resolved
packages/core/src/combinator/zip.ts Outdated Show resolved Hide resolved
packages/core/src/invoke.ts Outdated Show resolved Hide resolved
Copy link
Member

@briancavalier briancavalier left a comment

Choose a reason for hiding this comment

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

Slowly but surely, I'm working my way through. Thanks being patient and continuing to work through this.

packages/core/src/fusion/Map.ts Outdated Show resolved Hide resolved
packages/core/src/sink/IndexSink.ts Outdated Show resolved Hide resolved
Copy link
Member

@Frikki Frikki left a comment

Choose a reason for hiding this comment

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

PropagateTask.ts reviewed.

packages/core/src/scheduler/PropagateTask.ts Outdated Show resolved Hide resolved
packages/core/src/scheduler/PropagateTask.ts Outdated Show resolved Hide resolved
packages/core/src/scheduler/PropagateTask.ts Outdated Show resolved Hide resolved
Copy link
Member

@briancavalier briancavalier left a comment

Choose a reason for hiding this comment

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

Whew! I think I made it all the way to the end 😄 Thanks for continuing to move this forward! A few more questions and comments.

packages/disposable/src/disposeAll.ts Show resolved Hide resolved
packages/disposable/src/disposeAll.ts Outdated Show resolved Hide resolved
packages/disposable/test/disposeAll-test.ts Outdated Show resolved Hide resolved
packages/disposable/test/disposeAll-test.ts Show resolved Hide resolved
packages/prelude/src/array.ts Outdated Show resolved Hide resolved
packages/prelude/test/array-test.ts Show resolved Hide resolved
packages/scheduler/src/ScheduledTask.ts Show resolved Hide resolved
packages/scheduler/src/Scheduler.ts Outdated Show resolved Hide resolved
packages/scheduler/src/Timeline.ts Show resolved Hide resolved
packages/scheduler/src/ClockTimer.ts Show resolved Hide resolved
Copy link
Member

@briancavalier briancavalier left a comment

Choose a reason for hiding this comment

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

This is looking great overall. A couple more very minor comments.

packages/prelude/test/array-test.ts Show resolved Hide resolved
packages/prelude/src/array.ts Show resolved Hide resolved
@briancavalier
Copy link
Member

Hey @raveclassic, I haven’t forgotten about this. I’m on vacation with little to no internet access until 7 Oct. I’ll get back to this ASAP once I’ve returned.

@Frikki
Copy link
Member

Frikki commented Oct 2, 2019

Yea, @raveclassic, I haven’t forgotten either. Just very busy with an upcoming release at my day job, which have been stealing my energy for extra code and open source projects. I will also be back on track next week. Thanks for your patience.

@raveclassic
Copy link
Contributor Author

No problem, guys, I'm also on vacation right now until next week :)

@Frikki
Copy link
Member

Frikki commented Oct 9, 2019

I am delayed.

@raveclassic
Copy link
Contributor Author

Guys? :)

Copy link
Member

@briancavalier briancavalier left a comment

Choose a reason for hiding this comment

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

@raveclassic @Frikki I finally got back to this 😬

packages/prelude/src/array.ts Show resolved Hide resolved
# Conflicts:
#	package-lock.json
@briancavalier
Copy link
Member

Now that the most/prelude readonly array issue seems to be resolved, I've lost track of how close we are to the finish line overall.

@raveclassic Are there things you know are still left to do? If so, could you edit the PR description and list them (with checkboxes!). If not, then maybe we just need a final review and for at least one of the core team to pull a clean copy and ensure everything compiles and type checks.

Other thoughts on how to proceed?

@raveclassic
Copy link
Contributor Author

@briancavalier It seems like everything you and @Frikki mentioned is resolved. Do you remember what files/packages you haven't seen yet?

@briancavalier
Copy link
Member

briancavalier commented Nov 12, 2019

@raveclassic Thanks. I think I've been through all the files at one time or another. I feel like I need to do 2 things:

  • Pull a fresh copy of the latest, and run the build and test.
  • Go through all the files quickly again for one last sanity check.

I'll start on those now.

@briancavalier
Copy link
Member

Pull a fresh copy of the latest, and run the build and test.

I just did this and everything worked perfectly, except for the perf tests. Running the various test files directly with node works (since you added ts-node/register 👍), but the npm scripts (e.g., npm run chain) don't as they still reference babel-node.

I think it's an easy fix: We can update the package.json scripts from, e.g., babel-node --presets env ./chain.js to node ./chain.js.

Now I'm on to a final skim review of all the files.

return
}
this.sink.event(t, indexValue.value)
}

_dispose (t, index) {
private dispose(t: Time, index: number): void {
Copy link
Member

Choose a reason for hiding this comment

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

Thank you for making all the "private by convention" methods actually private .

Copy link
Member

@briancavalier briancavalier left a comment

Choose a reason for hiding this comment

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

I made it through a quick scan of all the files again 😌. Looks good to merge!

Thank you for this monumental effort and your patience while we all worked through it together, @raveclassic. Great work.

Copy link
Member

@Frikki Frikki left a comment

Choose a reason for hiding this comment

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

I think that now that tests are passing, we should get this PR into production.

@briancavalier briancavalier merged commit e37adda into mostjs:master Nov 20, 2019
@raveclassic
Copy link
Contributor Author

@briancavalier Turns out this has never been released :D Could you publish the new version?

@briancavalier
Copy link
Member

briancavalier commented Sep 30, 2020

Hey @raveclassic. Whoops! Thanks for the nudge. Just published updated versions of everything:

Successfully published:
 - @most/core@1.6.0
 - @most/disposable@1.3.0
 - @most/prelude@1.8.0
 - @most/scheduler@1.3.0
 - @most/types@1.1.0
lerna success published 5 packages

@nissoh
Copy link
Contributor

nissoh commented Oct 1, 2020

Hey @raveclassic. Whoops! Thanks for the nudge. Just published updated versions of everything:

Successfully published:
 - @most/core@1.6.0
 - @most/disposable@1.3.0
 - @most/prelude@1.8.0
 - @most/scheduler@1.3.0
 - @most/types@1.1.0
lerna success published 5 packages

@briancavalier i get a Typescript transpiling error because of a wrong reference to the entry TS file within package.json

check PR #525

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

Successfully merging this pull request may close these issues.

5 participants