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

Feat/add w3c svg render method shiyu proposal #133

Conversation

phanshiyu
Copy link
Contributor

@phanshiyu phanshiyu commented Apr 22, 2024

What

  1. use discriminated unions for displayResult
  2. added loading state and option for users' own component
  3. Use type import to prevent importing of crypto stuff again, reducing build size from 2mb to 600kb
  4. bunch of refactors (see commits)

make sure we handle these scenarios
Screenshot 2024-04-23 at 12 43 01 AM

@phanshiyu phanshiyu requested a review from yapyuyou April 22, 2024 16:39
@yapyuyou yapyuyou self-requested a review April 23, 2024 02:40
@phanshiyu phanshiyu merged commit f05b476 into feat/add-w3c-svg-render-method Apr 23, 2024
1 check passed
@phanshiyu phanshiyu deleted the feat/add-w3c-svg-render-method-shiyu-proposal branch April 23, 2024 02:40
yapyuyou added a commit that referenced this pull request Apr 24, 2024
* feat: initial commit

* fix: a couple of lint issues

* fix: lint

* test: add SvgRenderer test

* test: temporarily ignore lint

* test: try dynamic import

* test: try dynamic import again

* chore: upgrade jest to v29.7.0

* test: change base58 lib and add svg renderer tests

* chore: clean up and handle no template case

* fix: lint

* fix: install jest-environment-jsdom

* feat: add SvgModifiedTemplate and test

* chore: clean up

* chore: downgrade OA until v4 is ready

* fix: build

* chore: fix some issues and clean up

* fix: lint

* test: add demo svg template

* docs: update README with svgRenderer

* fix: make url test pattern less strict

* chore: add examples for v2 svg renderering

* fix: README not displaying raw svg

* fix: aws-crypto/sha256-browser instead

* fix: use React.forwardRef instead

* fix: lint

* fix: clean up props and change onConnected to onResult

* fix: use let for source instead

* fix: take out fetch method and add temporary typing for v4

* fix: add v2adapter component

* fix: add AbortController

* fix: example applicationsvg sample

* fix: use img instead of iframe and update README

* chore: include error in onResult, change enums to string, and update tests

* chore: update README

* fix: add TODO comment

Co-authored-by: Kyle Huang Junyuan <[email protected]>

* fix: set forwarded ref directly

* fix: lint

* Feat/add w3c svg render method shiyu proposal (#133)

* refactor: new discrimated union typings for display results

* fix: use new display results and new higher level methods to update display results

* refactor: shift render svg method out of the render fn

* fix: ignoring of exhuastive deps eslint

* fix: handle state where svg is malformed

* fix: handle loading state

* refactor: remove explict handle of default case

* refactor: make adaptor props extends from svg renderer directly

* test: fix tests and added a new test for malformed svg

* chore: use onResult and loading component in example application

* fix: should reset state on document change

* fix: hide img until it is resolved

* chore: use new interface and show malformed as an example

* refactor: remove one unnecessary dep

* chore: use type import to prevent importing crypto module

* fix: typings in adapter

* fix: should not alter svg width

* chore: remove crypto fallback to avoid bundling it in the future

* refactor: use imports instead

* fix: load error can also be caused by cors

---------

Co-authored-by: Phan Shi Yu <[email protected]>

* fix: remove unnecessary renderMethod properties

* fix: handle case when renderMethod is present but none of type SvgRenderingTemplate2023

---------

Co-authored-by: Kyle Huang Junyuan <[email protected]>
Co-authored-by: Phan Shi Yu <[email protected]>
Co-authored-by: Phan Shi Yu <[email protected]>
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.

2 participants