-
Notifications
You must be signed in to change notification settings - Fork 664
fix(rome_playground): Unicode Support #2332
Conversation
They playground crashed because `btoa` only supports ASCII. This PR ensures that non ASCII characters are propertly encoded before running the code throuh `btoa`.
@@ -22,7 +22,7 @@ jobs: | |||
node-version: '14' | |||
- run: npm install --prefix crates/rome_playground | |||
- uses: jetli/wasm-pack-action@v0.3.0 | |||
- run: wasm-pack build crates/rome_playground --target web | |||
- run: wasm-pack build crates/rome_playground --target web --release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reduces the wasm size by 0.5 mb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hum... if we have not done anything to reduce, can this help?
https://rustwasm.github.io/book/reference/code-size.html
@@ -2,7 +2,7 @@ import CodeEditor from "@uiw/react-textarea-code-editor"; | |||
import "react-tabs/style/react-tabs.css"; | |||
import init, { run } from "../pkg/rome_playground"; | |||
import { Tabs, Tab, TabList, TabPanel } from "react-tabs"; | |||
import {useEffect, useMemo, useState} from "react"; | |||
import { useEffect, useMemo, useState } from "react"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: We should probably move the playground into the website directory. It isn't a proper "rome" rust crate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same thing that I suggested a while ago.
Deploying with Cloudflare Pages
|
They playground crashed because
btoa
only supports ASCII.This PR ensures that non ASCII characters are propertly encoded before running the code throuh
btoa
.Summary
Test Plan