8000 fix autogenerated element (#397) · Linux4SA/pyscript@0476627 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 0476627

Browse files
authored
fix autogenerated element (pyscript#397)
* use static string in checkId to simplify behaviour and ensure ids always start with alpha char * re-enable terser on minify * fix example local path
1 parent eba42ad commit 0476627

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pyscriptjs/examples/todo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
<body class="container">
2020
<!-- <py-repl id="my-repl" auto-generate="true"> </py-repl> -->
21-
<py-script src="/todo.py"> </py-script>
21+
<py-script src="./todo.py"> </py-script>
2222

2323
<main class="max-w-xs mx-auto mt-4">
2424
<section>

pyscriptjs/rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export default {
8484
file: "examples/build/pyscript.min.js",
8585
format: "iife",
8686
sourcemap: true,
87-
// plugins: [terser()],
87+
plugins: [terser()],
8888
},
8989
],
9090
plugins: [

pyscriptjs/src/components/base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class BaseEvalElement extends HTMLElement {
5454
}
5555

5656
checkId() {
57-
if (!this.id) this.id = this.constructor.name + '-' + guidGenerator();
57+
if (!this.id) this.id = 'py-' + guidGenerator();
5858
}
5959

6060
getSourceFromElement(): string {

0 commit comments

Comments
0 (0)
0