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

Unstable implementation of MSC3089: File Trees #1732

Merged
merged 19 commits into from
Jun 14, 2021
Merged

Conversation

turt2live
Copy link
Member

@turt2live turt2live commented Jun 10, 2021

This is a heavily opinionated set of classes to help downstream projects implement file trees. There is no UI component to this (for now). As an unstable implementation, this has known gaps that will be filled (eventually, probably).

This has a very specific usecase (managed file trees) and is not entirely ready for usecases like Element or bridges yet - its opinions are formed out of this usecase.

Such opinionated code is a bit of a first in the js-sdk stack, but for this sort of downstream project it helps with development. The downstream project using this is even more opinionated, and it is expected that the before dropping the unstable flag that this implementation would be refactored to match whatever structure the js-sdk has at that time. Please ping me on Matrix for more information/reference material (if appropriate).

There is no expectation or guarantee that this API surface be maintained as such. Breaking changes are encouraged and expected.

The NamespacedValue stuff is borrowed from the Extensible Events implementation PR in the react-sdk as a useful thing to put here. When/if the MSCs become stable, we'd convert the values to enums and drop the constants (or keep them for migration purposes, but switch to stable).


MSC: matrix-org/matrix-spec-proposals#3089
Includes part of MSC3088 (room subtyping): matrix-org/matrix-spec-proposals#3088

Note for diligent community members: This does not count as an MSC implementation due to the lack of UI component.

MSC: matrix-org/matrix-spec-proposals#3089
Includes part of MSC3088 (room subtyping): matrix-org/matrix-spec-proposals#3088

The NamespacedValue stuff is borrowed from the Extensible Events implementation PR in the react-sdk as a useful thing to put here. When/if the MSCs become stable, we'd convert the values to enums and drop the constants (or keep them for migration purposes, but switch to stable). 

This flags the whole thing as unstable because it's highly subject to change.
src/utils.ts Outdated Show resolved Hide resolved
src/client.ts Outdated Show resolved Hide resolved
spec/unit/utils.spec.js Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
@matrix-org matrix-org deleted a comment from t3chguy Jun 10, 2021
@turt2live turt2live requested a review from t3chguy June 10, 2021 21:38
src/@types/requests.ts Outdated Show resolved Hide resolved
src/NamespacedValue.ts Show resolved Hide resolved
src/NamespacedValue.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
src/models/MSC3089TreeSpace.ts Show resolved Hide resolved
src/models/MSC3089TreeSpace.ts Show resolved Hide resolved
spec/unit/utils.spec.js Outdated Show resolved Hide resolved
src/client.ts Outdated Show resolved Hide resolved
src/models/MSC3089TreeSpace.ts Outdated Show resolved Hide resolved
@turt2live turt2live requested a review from t3chguy June 11, 2021 17:43
@turt2live
Copy link
Member Author

@t3chguy ptal. I've punted a proper conversion of the utils test out to element-hq/element-web#17630 in the interest of speed.

src/utils.ts Outdated Show resolved Hide resolved
spec/unit/utils.spec.ts Show resolved Hide resolved
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
@turt2live turt2live requested a review from t3chguy June 14, 2021 14:31
expect(baseToString(BigInt(53), "abcdefghijklmnopqrstuvwxyz")).toEqual('cb');
// Verify the whole alphabet
for (let i = BigInt(1); i <= DEFAULT_ALPHABET.length; i++) {
console.log({i}); // for debugging
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can probably go away now, or be added to the message on the expect itself

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keeping it around for the debugging side, like the other test which does this. Can't have expect messages without a library, so out of scope for this PR.

spec/unit/utils.spec.ts Outdated Show resolved Hide resolved
spec/unit/utils.spec.ts Show resolved Hide resolved
@turt2live turt2live requested a review from t3chguy June 14, 2021 17:56
Copy link
Member

@t3chguy t3chguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate everything about lexicographic ordering

:shipit:

@turt2live turt2live merged commit 759eca6 into develop Jun 14, 2021
@turt2live turt2live deleted the travis/file-trees branch June 14, 2021 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants