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

Correct package.json name to rdfjs org #4

Merged
merged 1 commit into from
May 6, 2021
Merged

Conversation

blake-regalia
Copy link
Contributor

No description provided.

@tpluscode
Copy link
Contributor

What is the benefit of this change? Keeping the name rdf-js will not require any changes in code.

If we do this, however, everyone will have to update all of their imports.

@blake-regalia
Copy link
Contributor Author

Nothing has to break, we can publish over rdf-js to proxy this package. Bringing the package under the rdfjs org aligns it with this repo and signals that it is endorsed and maintained by the RDFJS team.

@matthieubosquet
Copy link
Contributor

matthieubosquet commented Dec 17, 2020

That sounds awesome, I do agree it would bring clarity and consistency!

I still find it hard to find my way through the RDF JS ecosystem and its many libraries. Having an authoritative namespace under which a few packages are maintained and considered canonical implementations is a big plus to not be discouraged. As a developer, I find it much more intuitive and less confusing to install @rdfjs/types which I know is endorsed by the Community Group.

Also, rdf-js was last published two years ago anyway and this is a major release so for someone updating their types, the simple action of installing a new package seems like a fairly small overhead. Which brings me to think it's a sensible time to do it.

@tpluscode
Copy link
Contributor

So we then agree to publish both rdf-js and @rdfjs/types?

@matthieubosquet
Copy link
Contributor

matthieubosquet commented Dec 17, 2020

Alternatively, rdf-js could be deprecated and point to the newer @rdfjs/types for people wishing to update to the major version 2.x of the types. I think that solution would defuse potential confusion and allow people to organically discover that the types have a new major release and slowly migrate to the canonical URL rather than having rdf-js linger around forever.

The other question that seemed more important is how to proxy @types/rdf-js to the canonical/authoritative @rdfjs/types. It seems unclear what the best way forward in that matter is. But I don't think it should hold off publishing @types/rdf-js.

@tpluscode
Copy link
Contributor

tpluscode commented Dec 17, 2020

Alternatively, rdf-js could be deprecated

I'm still not convinced. Keeping rdf-js does not break anyone's code. Even if it's only s/rdf-js/@rdfjs\/types/ I think it's unnecessarily disruptive. All everyone would otherwise change is the package.json entry

The other question that seemed more important is how to proxy

You mean what happens when we finally start publishing our own package? I have not experienced it first hand as typings author but Definitely Typed has a policy for removing packages. They recommend removing the @types/ package as soon as we publish our own. At which point I think an empty package is published with deprecation warning on npm install.

@matthieubosquet
Copy link
Contributor

matthieubosquet commented Dec 17, 2020

The current situation is already disruptive since there are two concurrent packages rdf-js and @types/rdf-js and in fact, on the homepage of the rdf-js package it clearly states: "Do not install this package directly". See: https://www.npmjs.com/package/rdf-js

As a result and for the past 2 years, I think most people (including me and most of the recent repositories I've encountered) have been relying on @types/rdf-js, not on rdf-js. If removing the @types/rdf-js package is ok in your opinion, I don't see how deprecating rdf-js is a problem in comparison.

First, deprecating rdf-js will not force anyone to update their dependency, once again to a new major so not an automatic update anyway, it will instead show a deprecation message when they install it incentivising them to install the authoritative/canonical package. See: https://docs.npmjs.com/using-deprecated-packages.

Second, there is nothing in the rdf-js package name that hints towards the fact that it is a types library rather than an implementation of the RDF/JS specification. It confused everyone I've talked to.

Third, The brand name RDF/JS is a great asset, it would be a shame not to use it. Including it in the package name makes the endorsement/source clear and it's very helpful/reassuring, even more so to new developers of which we can only hope there will be more in the future.

Thanks for the link to the policy for removing packages on DefinitelyTyped, it makes things clearer. Great to see that this process properly deprecates @types packages and links them to the relevant repo. See: https://www.npmjs.com/package/@types/3d-bin-packing

@tpluscode
Copy link
Contributor

tpluscode commented Dec 18, 2020

Curious that I have never experience the confusion you refer to. Let me give you a complete example.

I think most people have been relying on @types/rdf-js, not on rdf-js.

You only consider package.json? Any project using the types will install @types/rdf-js, which pretends to be type declarations for rdf-js. (The fact that this package actually exists is right now irrelevant).

Thus, in code you will find imports like:

import { NamedNode } from 'rdf-js'

By reviving rdf-js for the types no code will have to change. The next patch release of @types/rdf-js will simply install rdf-js as its dependency and thus all other @types packages which depend on RDF/JS spec (for example type for parsers/serializers) will continue to seamlessly work because all of their imports will still be valid.

If removing the @types/rdf-js package is ok in your opinion, I don't see how deprecating rdf-js is a problem in comparison.

Again, the current package will not be removed. It will simply proxy to a new "real" package to ease adoption. How it "is a problem in comparison"? Read below


Now, changing the name to @rdfjs/types will completely break everyone. I expect that the necessary updates will create a snowball effect and it will likely continue until everyone migrates to the new package.

The problem is similar to what can happen if you somehow end up with multiple versions of @types/rdf-js. Duplicate declarations of type can be falsely identified as incompatible in weird places in your modules, preventing successful build.


So while I agree that if we were starting from a clean slate, I too would opt for a more natural, less confusing package name, at this point we do not have that luxury. We're looking at an existing ecosystem which we cannot afford to break and that should trump the arguments about people being confused.

@tpluscode
Copy link
Contributor

Nothing has to break, we can publish over rdf-js to proxy this package.

@blake-regalia, so you propose to publish rdf-js with a single index.d.ts module?

export * from '@rdfjs/types`

@rubensworks
Copy link
Member

Apologies for the late reply, but I agree with @tpluscode's stance on this.

Using this other package name will be break all existing packages, requiring them to change all imports.
Whereas just migrating to rdf-js would allow people to keep all of their existing code unchanged (and be compatible with other packages that have not yet been updated to the new typings).

So I'm against merging this PR.

@blake-regalia
Copy link
Contributor Author

Coming back to this thread, I suggest we deprecate the other packages and point to o@rdfjs/types as the single source of truth for RDFJS typings. Package deprecation is not a big deal guys. Let's clean this up once and for all.

@tpluscode
Copy link
Contributor

@blake-regalia you agree with my #4 (comment) ?

As long as we won't have everyone change their imports right away I can agree with what happen's here

@blake-regalia
Copy link
Contributor Author

I initially proposed making rdf-js a proxy lib, but then we would have to maintain two packages in order to keep semvers up to date. I believe the more appropriate course of action here is to simply deprecate the other package and point users to the scoped package @rdfjs/types. Keep in mind, nobody's code will break. When they are ready to migrate then they can do so.

More technically: I would propose publishing a new minor semver version of rdf-js and then immediately deprecate only that version. This would ensure that when a user installs a module that depends on rdf-js they are not met with a deprecation message. When developers are ready to upgrade however, then they can perform migration.

@tpluscode
Copy link
Contributor

tpluscode commented Mar 15, 2021

Word of caution

The proxy package could just have a single version and a dependency on "@rdf-js/types": "*". Actually trying to use sem ver is asking for trouble. Conflicting versions of multiple types versions easy lead to weird npm/yarn resolutions and broken build. We had a long discussion about @rdfjs/data-model which had a dependency on a specific version of the types. It was a constant issue until it became a "star" dependency. (rdfjs-base/data-model#24 (comment))

@blake-regalia
Copy link
Contributor Author

Started an open discussion in DefinitelyTyped gitter channel to clarify the removal/deprecation process here: https://gitter.im/DefinitelyTyped/DefinitelyTyped?at=609382c70845c416dcc8497b

@blake-regalia
Copy link
Contributor Author

After a productive discussion with @tpluscode - I agree with the proxy package which has a wildcard dependency on the @rdfjs/types package.

I will be merging this PR now that we have resolved how to proceed with the DefinitelyTyped package.

@blake-regalia blake-regalia merged commit 0ebac16 into master May 6, 2021
@blake-regalia blake-regalia deleted the fix/package-name branch May 6, 2021 06:26
@tpluscode
Copy link
Contributor

I believe we need a new repo for rdf-js and publishing setup? @rubensworks, you previously published that on NPM...

@rubensworks
Copy link
Member

I believe we need a new repo for rdf-js and publishing setup?

Isn't that the purpose of this repo here? Also #3.

@rubensworks, you previously published that on NPM...

That's just a stub package, we can easily publish over that when we get to that point :-)

@tpluscode
Copy link
Contributor

Isn't that the purpose of this repo here?

In which case I come back to proposing a monorepo, albeit with one of the two packages really not changing much, and changesets to make publishing easy for maintainers

when we get to that point :-)

we are very close to that point

@rubensworks
Copy link
Member

one of the two packages

What packages do you have in mind?
I see only one package (the one coming from @types/rdf-js).

@tpluscode
Copy link
Contributor

  1. @rdfjs/types -> the real one we have here right now
  2. rdf-js -> a proxy package

@rubensworks
Copy link
Member

Ah ok, so actually there will be 2 proxy packages: @types/rdf-js will be a proxy to rdf-js, and rdf-js will immediately also be a proxy to @rdfjs/types.
Thanks for the clarification!

Since rdf-js should not need further changes after its initial release, it might be better to just have a separate repo for this, which we can then ignore.

@tpluscode
Copy link
Contributor

Since rdf-js should not need further changes after its initial release, it might be better to just have a separate repo for this, which we can then ignore.

Yes, also an option :)

@blake-regalia
Copy link
Contributor Author

Sounds good to me

Vinnl added a commit to inrupt/solid-client-js that referenced this pull request Jun 4, 2021
The package has been moved off DefinitelyTyped by upstream:
DefinitelyTyped/DefinitelyTyped#51756 and
rdfjs/types#4.
Vinnl added a commit to inrupt/solid-client-js that referenced this pull request Jun 4, 2021
The package has been moved off DefinitelyTyped by upstream:
DefinitelyTyped/DefinitelyTyped#51756 and
rdfjs/types#4.
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