-
-
Notifications
You must be signed in to change notification settings - Fork 765
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
Fix issues with typings using classes, publish @core typings, and fix 3.1 typings #792
Fix issues with typings using classes, publish @core typings, and fix 3.1 typings #792
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.
Worked
Please refer to comment: Why this was closed |
I think because 0.8.1 didn't include them at all. So while the types kind
of suck currently, at least they're included
…On Thu, Sep 12, 2019, 1:12 PM Corbin Crutchley ***@***.***> wrote:
Reopened #792 <#792>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#792>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAQGPCSYG5CNIK67SEG4D5DQJJZ77ANCNFSM4IWF5LVQ>
.
|
…TS3.1 from packagejson
This PR removes the new typings for 3.1 from being exposed to TS and reverts architectural changes in TLDR It works for now ™️ |
@crutchcorn Are you not moving forward with this? I want to get you to a point where you don't have sleepless nights ❤️ |
@hipstersmoothie I'll be back in a week or so to take another stab at this (3.1 and otherwise). I think this PR is still good (at least the typings for <3.1 TS), but just needs to export using this: Because it's using Either way, I'll be back eventually. If this PR wants to be opened again before then and you (@hipstersmoothie) wants to commit directly to this PR, I am allowing maintainers to make edits. Otherwise, if work wants to be done before then and someone else wants to fork off of my fork and go from there please feel free |
types
folder for jimp and @jimp/core for buildstypes
folder for jimp and @jimp/core for builds
types
folder for jimp and @jimp/core for builds
The previous commit HAS fixed one of the larger issues with the code, but tomorrow I need to have a more thorough discussion with @hipstersmoothie regraurding supported. I'll be sending an email tomorrow morning (PDT) about that |
Copying from an email I sent to @hipstersmoothie: There's some questions I had regarding what the supported method of It seems there's also been a bit of API churn in this way as well: So then, the questions are:
I personally think we should not allow Regardless of our choice, we should edit the README. I know how to achieve the types of all of these, but I just need to know which route we're wanting to go. Keep in mind, these answers will impact how we handle our tsconfig.js |
After the |
This just has to work in plain JS. In TS i'm fine if that doesn't work |
I've made the ability to use
As a result, I have updated the docs in the |
I assume you know this, but generally if Microsoft recommends projects to aim to have the flag on. |
@amirburbea I actually struggle a lot when it comes to |
This might mean that the comment here: #785 (comment) Is not accurate. Again, I'll defer to @amirburbea as I'm unfamiliar with the different import techniques w/ the config settings |
This requires us to remove 3.1 typings, left a note in the 3.1 tests on how to enable them again when things are working properly.
This is confirmed working by some folks testing from the issue. @hipstersmoothie let's go ahead and merge this, cut a release, then I'll open up a new issue for the problems with the 3.1 typings, then make a PR to fix that |
🚀 PR was released in v0.8.3 🚀 |
What's Changing and Why
Copied from #785 (comment)
Unrelated notes on TS that I noticed while debugging this PR
There were two more things that I wanted to bring up here (just to keep everyone up-to-date, neither of these issues are breaking or should be handled now):
require
no longer works for typings. This may have been noticed by @hipstersmoothie even when trying to fix tests in 0.6: 7dff287#diff-9687f7d238d1b6cbaf5bddfd10b57491L5The reason
const Jimp = require('jimp')
doesn't work with types anymore is because now it's underJimp.default
. Now, if we wanted to enable this functionality again, we could easily changeindex.d.ts
file fromjimp
like so:But then the problem is that, as the TS language extensions will tell you, you cannot export like this and have any other exports. To get around this in the past, we used namespaces:
https://github.com/oliver-moran/jimp/blob/14055cf60e66701987bb148a2d389844dd0e9cb4/packages/jimp/jimp.d.ts
So if we're wanting to restore said functionality, we'd need to do the same thing today. Otherwise, if we're okay with it being as it is (the
import
works just fine), we should likely remove therequire
example from the README@types/node
. Now, again, this was not introduced in 0.8 and it's actually somewhat hard to pinpoint when this was introduced (the type in question that it relies on isBuffer
. Now, there's a few things we could do here:@types/node
typings to inform the user that we expect them to have it installedBuffer
type ~ due to (seemingly) only having one type from that package we depend on we could likely just copy the type to be local. The issue here is that maintanance and type interop are a big problem - I'd highly suggest against this onePublished PR with canary version:
0.8.2-canary.792.360.0