Draft: Scratch changes for matrix-public-archive#653
Draft
MadLittleMods wants to merge 71 commits intomasterfrom
Draft
Draft: Scratch changes for matrix-public-archive#653MadLittleMods wants to merge 71 commits intomasterfrom
matrix-public-archive#653MadLittleMods wants to merge 71 commits intomasterfrom
Conversation
See plan https://docs.google.com/document/d/1wP_TIqmBQjtt862vb2CWWmnmVxTyolcF3J1scuiYMdg/edit# 1. Trying to make it faster/easier to build `hydrogen.es.js` for local linking and dev in `matrix-public-arhive` project 1. Some random changes to accomodate using raw `EventEntry`'s
MadLittleMods
commented
Feb 2, 2022
MadLittleMods
commented
Feb 9, 2022
| // find any local relations to these new remote events or maybe these | ||
| // new remote events reference one of the other new remote events we have. | ||
| const entryList = new ConcatList(entries, this._localEntries); | ||
| for (const pee of entryList) { |
Contributor
Author
There was a problem hiding this comment.
This makes emoji reactions show up on messages.
(the m.reaction events are in the list of events we're rendering)
MadLittleMods
commented
Feb 9, 2022
MadLittleMods
added a commit
that referenced
this pull request
Feb 12, 2022
…dom`](https://github.com/WebReflection/linkedom) (SSR). - [`linkedom`](https://github.com/WebReflection/linkedom) is being used https://github.com/matrix-org/matrix-public-archive to server-side render (SSR) Hydrogen (`hydrogen-view-sdk`) - This is being fixed by using a explicit HTML wrapper boilerplate with `DOMParser` to get a matching result in the browser and `linkedom`. Currently `parseHTML` is only used for HTML content bodies in events. Events with replies have content bodies that look like `<mx-reply>Hello</mx-reply> What's up` so they're parsed as HTML to strip out the `<mx-reply>` part. Before | After --- | ---  |  Before: ```js // Browser (Chrome, Firefox) new DOMParser().parseFromString(`<div>foo</div>`, "text/html").body.outerHTML; // '<body><div>foo</div></body>' // `linkedom` ❌ new DOMParser().parseFromString(`<div>foo</div>`, "text/html").body.outerHTML; // '<body></body>' ``` After (consistent matching output): ```js // Browser (Chrome, Firefox) new DOMParser().parseFromString(`<!DOCTYPE html><html><body><div>foo</div></body></html>`, "text/html").body.outerHTML; // '<body><div>foo</div></body>' // `linkedom` new DOMParser().parseFromString(`<!DOCTYPE html><html><body><div>foo</div></body></html>`, "text/html").body.outerHTML; // '<body><div>foo</div></body>' ``` `linkedom` goal is to be close to the current DOM standard, but [not too close](https://github.com/WebReflection/linkedom#faq). Focused on the streamlined cases for server-side rendering (SSR). Here is some context around getting `DOMParser` to interpret things better. The conclusion was to only support the explicit standard cases with a `<html><body></body></html>` specified instead of adding the magic HTML document creation and massaging that the browser does. - WebReflection/linkedom#106 - WebReflection/linkedom#108 --- Part of #653 to support server-side rendering Hydrogen for the [`matrix-public-archive`](https://github.com/matrix-org/matrix-public-archive) project.
MadLittleMods
commented
Feb 12, 2022
MadLittleMods
commented
Feb 12, 2022
MadLittleMods
commented
Feb 12, 2022
| new TimelineLoadingView(vm); // vm is just needed for i18n | ||
| }), | ||
| t.view(bottomView), | ||
| bottomView ? t.view(bottomView) : text(''), |
Contributor
Author
There was a problem hiding this comment.
Just trying to not render the composer when no vm.composerViewModel.kind matches with the goal to hide the composer.
…h-changes Conflicts: scripts/sdk/base-manifest.json src/platform/web/parsehtml.js
This was referenced Feb 14, 2022
…hrowing and stopping all JavaScript Related to #579 ``` Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'deriveBits') at new Crypto at new Platform at mountHydrogen ```
MadLittleMods
added a commit
that referenced
this pull request
Feb 25, 2022
Split off from #653 Personally using `select`, `option`, and `path` currently in https://github.com/matrix-org/matrix-public-archive but added a few extra SVG elements that seemed common to me.
MadLittleMods
commented
Feb 25, 2022
See #653 (comment) We can allow this to run now since I added support for `setProperty` in `linkedom` ⏩ WebReflection/linkedom#114
MadLittleMods
added a commit
that referenced
this pull request
Feb 25, 2022
…ing in tests Split out from #653 Example test assertions: https://github.com/matrix-org/matrix-public-archive/blob/db6d3797d74104ad7c93e572ed106f1a685a90d0/test/e2e-tests.js#L248-L252 ```js // Make sure the $abc event on the page has "foobarbaz" text in it assert.match( dom.document.querySelector(`[data-event-id="$abc"]`).outerHTML, new RegExp(`.*foobarbaz.*`) ); ```
…op as well and continue reading See `?continue=top` in matrix-org/matrix-viewer#114 for how this is used
This would be helpful for matrix-org/matrix-viewer#73
MadLittleMods
commented
Nov 9, 2022
MadLittleMods
commented
Nov 10, 2022
…h-changes Conflicts: src/domain/session/room/LightboxViewModel.js
MadLittleMods
commented
Nov 11, 2022
1 task
… menu option for it now
1 task
…h-changes Conflicts: src/domain/ViewModel.ts src/domain/navigation/index.ts src/domain/session/SessionViewModel.js src/domain/session/room/RoomViewModel.js src/domain/session/room/timeline/tiles/BaseMessageTile.js src/domain/session/room/timeline/tiles/SimpleTile.js src/matrix/room/PowerLevels.js src/platform/web/dom/utils.ts src/platform/web/ui/session/room/timeline/BaseMessageView.js
2 tasks
MadLittleMods
commented
Apr 26, 2023
Useful to quickly grab the MXC URL's to quarantine media in moderation scenarios
MadLittleMods
commented
May 26, 2023
Comment on lines
+15
to
+19
| pushd target/ | ||
| # Make sure the dependencies are available for any consuming project that uses | ||
| # `npm link hydrogen-view-sdk` | ||
| yarn install --no-lockfile | ||
| popd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scratch changes for
matrix-public-archive(not available yet)See plan https://docs.google.com/document/d/1wP_TIqmBQjtt862vb2CWWmnmVxTyolcF3J1scuiYMdg/edit#
hydrogen.es.jsfor local linking and dev inmatrix-public-arhiveprojectyarn run vite build -c vite.sdk-lib-config.js --watchEventEntry'sDev notes
Supporting the Node.js CommonJS environment (
package.jsonexports)Getting CommonJS vs EcmaScript Modules working, d7290bf
package.jsonAlso added
"./assets/": "./asset-build/assets/"to theexportsso we can simply serve them withapp.use(express.static(path.dirname(require.resolve('hydrogen-view-sdk/assets/'))));eslint-plugin-nodewill complain about these entries but that's because it doesn't supportexports, see mysticatea/eslint-plugin-node#255package.jsonexportsdocsDocs source: https://github.com/webpack/webpack.js.org/blob/627c26026678f2f44c40a7631c7799c04936ff40/src/content/guides/package-exports.mdx (served at https://webpack.js.org/guides/package-exports/)
Vite
Server-side render Hydrogen
Can we just render straight to string?
Virtual DOM: