-
Notifications
You must be signed in to change notification settings - Fork 54
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
v10.0.0 tracking #199
v10.0.0 tracking #199
Conversation
Actions isn't showing the failing tests, it looks like |
pinging @achingbrain who might be able to see what's going on with the browser tests
that's supposed to be addressed with the browser export for |
Any changes to this file will get overwritten by the Unified CI bot, you should PR the source file instead. The change looks fine though, I don't think there's any need for it to be so restrictive.
Just looking into this. Normally you'd use the I think it might be related to these sorts of imports in the tests:
Before I go any futher in investigating is there any reason the import isn't using relative paths instead of trying to resolve multiformats from |
This project is relying on ESM Exports in the package.json and using the |
It uses esbuild for bundling. |
Weird. Esbuild should be detecting the |
Yeah, the whole thing is a bit weird to be honest - this module depends on The test then has: import { sha256 } from 'multiformats/hashes/sha2' ..so it's going to resolve to But, we're (accidentally?) importing from the hoisted If it was: import { sha256 } from '../src/hashes/sha2.js' with an override in the |
Aha! Good digging. I think it might actually be related to the package.json in the ts-use folder trying to load multiformats from the dist folder which no longer exists in this version |
I think we need to tests to import the |
Err, the error defs isn't due to the ts-use folder. 🤔 |
Did some digging in the build, and this is what's happening when it tries to import sha2 from the "test" directory:
I think the issue is that the tests are trying to import from |
Removing the "paths" section from tsconfig has yielded the following errors in the build:
|
Err, nvm I think I messed stuff up with that. 😅 |
Following from this discussion: ipld/js-dag-pb#56 (comment) I don't think we can have the |
I think in order to get the raw specifiers thing to work, we'll need to treat the tests as a separate module similar to how ts-use does it. |
2022-09-06 triage conversation: going to discuss async what the next steps are. |
651e665
to
27b4246
Compare
@RangerMauve I hope you don't mind but I'm going to force push your latest commit out of here since the tsconfig settings are to help get nicer local TS imports and they shouldn't impact external consumers. So .. thanks for the input @achingbrain, you're right about the import picking up the one in node_modules, it's been so long since we set all this weird layout up that I'd forgotten how most of it worked. IIRC what we have is something like:
So my current push to this branch removes the named dependencies and uses relative ones, plus the I've also added in most of the build scripts @achingbrain suggested in ipld/js-dag-pb#56, although I've customised the Also, it's a bit sad to move away from named imports for tests, it was nice consuming the package from the tests according to what's exported. But that's going to be pretty hard without the ipjs toolchain doing the work for us. We could go with the ts-use style sub-package just for testing, but even then, we have |
I've published a 10.0.0-pre.1 with this as it is now (FYI @Gozala in case you want to try out the Link work on something) |
`Object.defineProperties` is a performance bottleneck in applications that create lots and lots of CIDs (e.g. IPFS) so this PR removes it. The `asCID` property is changed to be a [private class field](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields) which requires increasing the minimum supported EcmaScript version but I don't know if that's a big deal or not. It does seem to make the property non-enumerable though. The CID class now implements a `Link` interface that has public `byteOffset` and `byteLength` properties so these become regular properties `code`, `version`, `multihash` and `bytes` become writable/configurable but they are marked with `@readonly` so maybe that's enough? Fixes #200
* chore: add test for structural copying * fix: remove generated import * fix: lint errors * fix: another attempt to make eslint happy * chore: and another attemp to make eslint happy
4dace7e
to
6bc85af
Compare
Ready to roll, 🤞 hoping that auto-release will give us a proper v10.0.0 on merge. Any final comments or objections? |
It should do as long as the commit title has a |
@rvagg : I think it's time to pull the trigger :) |
@BigLep yeah, I ran out of time yesterday to get the auto-release process tested - that it's not going to have problems with my pre-releases and that it's going to pick up a proper semver-major release for this. Thankfully I did bother testing because it wasn't going to semver-major this, I'd assumed that one of us had tagged at least one commit as breaking, but nope! Manually merging and manipulating the commit history for a bit of squashing and rewriting of comments. Will push that to master and it should release a 10.0.0. |
## [10.0.0](v9.9.0...v10.0.0) (2022-10-12) ### ⚠ BREAKING CHANGES * remove use of Object.defineProperties in CID class * use aegir for ESM-only build/testing/release ### Features * add complete set of aegir-based scripts ([1190bc6](1190bc6)) * define Link interface for CID ([88e29ea](88e29ea)) * remove deprecated CID properties & methods ([ffc4e6f](ffc4e6f)) * use aegir for ESM-only build/testing/release ([163d463](163d463)) ### Bug Fixes * --no-cov for all but chrome main ([b92f25f](b92f25f)) * add "browser" field, remove named local imports ([d60ea06](d60ea06)) * additional lint items from Link interface work ([91f677b](91f677b)) * address JS & TS linting complaints ([c12db2a](c12db2a)) * changes for new lint rules ([e6c9957](e6c9957)) * distribute types in dist/types/ ([c6defdb](c6defdb)) * ensure "master" as release branch ([16f8d9e](16f8d9e)) * make CID#asCID a regular property ([a74f1c7](a74f1c7)) * only release on master ([d15f26f](d15f26f)) * properly export types, build more complete pack ([8172ea8](8172ea8)) * remove "main" ([ad3306c](ad3306c)) * remove use of Object.defineProperties in CID class ([6149fae](6149fae)), closes [#200](#200) * run coverage only where it's supposed to ([872d121](872d121)) * test on all branches and pull requests ([f2ae077](f2ae077)) * ts-use import path ([53651c1](53651c1)) * use extensions for relative ts imports ([451998a](451998a)), closes [/github.com//pull/199#issuecomment-1252793515](https://github.com/multiformats//github.com/multiformats/js-multiformats/pull/199/issues/issuecomment-1252793515) * use parent `tsc` in ts-use ([85a9296](85a9296)) ### Tests * check for non-enumerability of asCID property ([b4ba07d](b4ba07d)) ### Trivial Changes * add test for structural copying ([#206](#206)) ([e8def36](e8def36)) * **no-release:** bump @types/mocha from 9.1.1 to 10.0.0 ([#205](#205)) ([a9a9347](a9a9347)) * **no-release:** bump actions/setup-node from 3.4.1 to 3.5.0 ([#204](#204)) ([604ca1f](604ca1f))
Includes both #197 and #196. Will comment in both of those what I've done.
I've also applied some additional linting to get #162 to jive with #167 and have also made js-test-and-release.yml run
on: [push, pull_request]
for now, that'll get updated soon enough with https://github.com/protocol/.github/blob/master/templates/.github/workflows/js-test-and-release.yml (although I'm not sure why it's so restrictive).Unfortunately for some reason, bringing both of the big PRs together makes aegir / pw-test fail to see the
"browser"
field for thehashes/sha2
export and it borks on not being able to find"crypto"
. I haven't figured out what's going on with that and I'm not sure what would have changed to start triggering that when it isn't happening in theesm-migration
branch. You can see what's changed here: https://github.com/multiformats/js-multiformats/compare/proposal/v10.0.0..esm-migrationOpen remaining items:
Items not in scope:
Items we'll be able to address afterwards as a result: