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
Prevent @types/node
and @types/requirejs
-confusion
#35946
Conversation
👋 Hi there! I’ve run some quick performance metrics against master and your PR. This is still an experiment, so don’t panic if I say something crazy! I’m still learning how to interpret these metrics. Let’s review the numbers, shall we? These typings are for a package that doesn’t yet exist on master, so I don’t have anything to compare against yet! In the future, I’ll be able to compare PRs to requirejs with its source on master. **Comparison details** 📊
If you have any questions or comments about me, you can ping |
@manuth Thank you for submitting this PR! 🔔 @jbaldwin - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
We've gotten sign-off from a reviewer 👏. A maintainer will soon review this PR and merge it if there are no issues. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for contributing to DefinitelyTyped! |
This seems extremely dangerous in terms of breaking existing code and JS users. I would need to see data in terms of what % of extant code uses |
Oh - I thought this should not damage any code as I increased the major version-number. |
@RyanCavanaugh is this a wrong assumption? |
So I just checked the guide of I updated the major version which means that no package will be affected. |
@RyanCavanaugh what's the status for this PR? |
I'm sorry to ask again, but why is this PR still not merged? |
Yes—the version number is supposed to represent the version of the JavaScript library on npm. The latest release of RequireJS is 2.3.6. In fact, @sandersn just added a CI rule to prevent type definitions from referencing non-existent versions of their JS counterparts. Echoing Ryan, I think we would want to see some data here. I think my hunch is that lots of RequireJS users probably use |
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.
It appears that @typescript-bot might have interpreted my trailing “👍” in that last comment as an approval? I’m requesting changes just so it’s clear the status is not mergeable without further research/discussion.
@manuth One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits or comments. Thank you! |
Honestly I don't think "people may want to keep using To me its a bad idea to prevent people from writing typescript-code just because "people want to use |
Here's a workaround: provide a node-specific version of the package which basically implements this change, but copy it into a subdirectory named
It should be possible to share the types between the main file and the node file, so that they only differ in the last few lines -- the main file would have 3 globals and the node file would have a single |
@sandersn I tried this locally, but |
@manuth I haven't seen anything from you in a while and this PR currently has problems that prevent it from being merged. The PR will be closed tomorrow if there aren't new commits to fix the issues. |
@manuth To keep things tidy, we have to close PRs that aren't mergeable but don't have activity from their author. No worries, though - please open a new PR if you'd like to continue with this change. Thank you! |
@RyanCavanaugh. @andrewbranch I'd be glad if you guys could discuss this further so I can open a new PR for resolving the |
@andrewbranch I was wrong about my fix, the errors you saw got lost in a bunch of others. I'm out of ideas on this one. |
Should I wait for you guys to work out a solution or should I rather open a new PR? |
My only idea is to publish a separate package, e.g. @types/requirejs-node. |
Part of request #14752 Unify scripts and themes build for Core Everything is supposed to work as before. Notes: Once again select2 has given me hell! I had to remove @types/select2 from TLP and fork it due to a types conflict between @types/node and @types/requirejs. The latter is a dependency of @types/select2, although we never use it in production code. I could not figure out how to exclude @types/requirejs, so the only solution left was to fork @types/select2 and remove manually the dependencies to @types/requirejs. The situation is unlikely to be resolved, see a related PR at [0] [0]: DefinitelyTyped/DefinitelyTyped#35946 Change-Id: I81b599c0094c13379fbebbe1abfb0d854044436f
Please fill in this template.
npm test
.)npm run lint package-name
(ortsc
if notslint.json
is present).Select one of these and delete the others:
If changing an existing definition:
I created this PR as many people are having trouble with
requirejs
overriding the variablerequire
:tslint.json
containing{ "extends": "dtslint/dt.json" }
.About this PR
According to the documentation,
@types/requirejs
can be invoked throughrequire()
andrequirejs()
.As
require()
is declared by@types/node
, too, which is part of most projects.For that reason I decided to make
@types/requirejs
exportingrequirejs()
rather thanrequire()
.