Skip to content

Commit

Permalink
chore(ssr): update building of ssr client
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovilia committed Jun 27, 2023
1 parent a632970 commit 6bca132
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 44 deletions.
1 change: 1 addition & 0 deletions .github/workflows/source-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
index.d.ts
src/
extension-src/
ssr/client/src/
licenses/
theme/
build/
Expand Down
36 changes: 0 additions & 36 deletions build/build-ssr-client.js

This file was deleted.

2 changes: 1 addition & 1 deletion build/pre-publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ async function tsCompile(compilerOptionsOverride, srcPathList) {
&& compilerOptionsOverride.rootDir
&& compilerOptionsOverride.outDir
);
console.log(compilerOptionsOverride, srcPathList)

let compilerOptions = {
...tsConfig.compilerOptions,
...compilerOptionsOverride,
Expand Down
109 changes: 109 additions & 0 deletions ssr/client/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ssr/client/dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ssr/client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface ECSSRClientOptions {

export type ECSSREvent = 'mouseover' | 'mouseout' | 'click';

export function initEChartsSSRClient(dom: HTMLElement, options: ECSSRClientOptions) {
export function hydrate(dom: HTMLElement, options: ECSSRClientOptions) {
const svgRoot = dom.querySelector('svg');
if (!svgRoot) {
console.error('No SVG element found in the DOM.');
Expand Down Expand Up @@ -58,7 +58,7 @@ export function initEChartsSSRClient(dom: HTMLElement, options: ECSSRClientOptio
const silent = child.getAttribute('ecmeta_silent') === 'true';
if (type && !silent) {
child.addEventListener(eventName, e => {
events[eventName as ECSSREvent]({
(events[eventName as ECSSREvent] as Function)({
type: eventName,
ssrType: type,
seriesIndex: getIndex(child, 'ecmeta_series_index'),
Expand Down
2 changes: 1 addition & 1 deletion test/lib/config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions test/ssr.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6bca132

Please sign in to comment.