GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Reexport Fraction types from fraction.js instead of using custom one by fchu · Pull Request #3330 · josdejong/mathjs

Conversation

@fchu

@fchu fchu commented Dec 3, 2024

Copy link
Copy Markdown
Contributor

This should fix #3317
FYI npm test passed but got issues with npm run test:types (prior to this PR that is), so an approver might want to double check

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@fchu
Reexport Fraction types from fraction.js instead of using custom one
011522c
@josdejong

josdejong commented Dec 4, 2024

Copy link
Copy Markdown
Owner

Thanks Francois!

I was just thinking: maybe we should just remove exporting the type definition of Fraction, and let TypeScript pick the type defintions from the Fraction.js library itself. If we export Fraction from mathjs, as an end user, you can import Fraction from two different sources: mathjs or Fraction.js. That is a duplicate. What do you think?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fchu

fchu commented Dec 6, 2024

Copy link
Copy Markdown
Contributor Author

I'm not an expert so I won't be able to give you the most informed answer.
I would think that if you remove the definition, the user will still have to import it from somewhere, which will either be their own direct import of fraction.js (which can be a different version), or have to find the exact version your package is depending on, which is an hassle. Maybe re-exporting it is just the user-friendly way to have access to the correct version of the type?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@josdejong
Merge branch 'develop' into fix-fraction-types
7a6fce5
@josdejong

josdejong commented Dec 11, 2024

Copy link
Copy Markdown
Owner

Hm, yeah. If we change that we should be consistent and not export the type definition of Fraction nor BigNumber. Ok let's leave the export in then 👍.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

josdejong
josdejong approved these changes Dec 11, 2024
View reviewed changes
@josdejong
josdejong merged commit 97da410 into josdejong:develop Dec 11, 2024
@josdejong

josdejong commented Dec 11, 2024

Copy link
Copy Markdown
Owner

Published now in v14.0.1, thanks again.

fchu reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@josdejong josdejong josdejong approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

fraction methods are not typed

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@fchu @josdejong
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.