-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
532 additions
and
577 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
// @ts-nocheck | ||
@customElement('my-element') | ||
class MyElement extends GemElement { | ||
@emitter change; | ||
@effect([]) | ||
method(arg) { | ||
console.log('method'); | ||
} | ||
@effect([]) | ||
field = (arg) => { | ||
console.log('field'); | ||
} | ||
}; | ||
@effect([]) | ||
#method(arg) { | ||
console.log('#method'); | ||
} | ||
@effect([]) | ||
@effect((i) => [i.#field]) | ||
#field = (arg) => { | ||
console.log('#field'); | ||
} | ||
}; | ||
#content; | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,34 @@ | ||
// @ts-nocheck | ||
@customElement('my-element') | ||
class MyElement extends GemElement { | ||
@emitter change; | ||
_hmr_public_my_element_method(arg) { | ||
console.log('method'); | ||
} | ||
@effect([]) | ||
method() { | ||
return this._hmr_public_my_element_method.bind(this)(...arguments); | ||
method(...args) { | ||
return this._hmr_public_my_element_method.bind(this)(...args); | ||
} | ||
_hmr_public_my_element_field(arg) { | ||
console.log('field'); | ||
} | ||
@effect([]) | ||
field = () => { | ||
return this._hmr_public_my_element_field.bind(this)(...arguments); | ||
field = (...args) => { | ||
return this._hmr_public_my_element_field.bind(this)(...args); | ||
}; | ||
_hmr_private_my_element_method(arg) { | ||
console.log('#method'); | ||
} | ||
@effect([]) | ||
_private_my_element_method() { | ||
return this._hmr_private_my_element_method.bind(this)(...arguments); | ||
_private_my_element_method(...args) { | ||
return this._hmr_private_my_element_method.bind(this)(...args); | ||
} | ||
_hmr_private_my_element_field(arg) { | ||
console.log('#field'); | ||
} | ||
@effect([]) | ||
_private_my_element_field = () => { | ||
return this._hmr_private_my_element_field.bind(this)(...arguments); | ||
@effect((i) => [i._private_my_element_field]) | ||
_private_my_element_field = (...args) => { | ||
return this._hmr_private_my_element_field.bind(this)(...args); | ||
}; | ||
_private_my_element_content; | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// swc 还是谁有 bug,装饰器没有生效 | ||
|
||
import { defineConfig } from '@rsbuild/core'; | ||
|
||
export default defineConfig(({}) => ({ | ||
html: { | ||
template: './src/template.html', | ||
}, | ||
source: { | ||
// 触发更新 | ||
preEntry: './src/manifest.json', | ||
entry: { | ||
test: './src/test.ts', | ||
sidebarpanel: './src/sidebarpanel.ts', | ||
devtools: './src/devtools.ts', | ||
// not support module | ||
content: { | ||
import: './src/content.ts', | ||
html: false, | ||
}, | ||
}, | ||
}, | ||
output: { | ||
copy: [{ from: './src/manifest.json' }], | ||
distPath: { | ||
root: 'extension', | ||
js: '.', | ||
}, | ||
filename: { | ||
js: '[name].js', | ||
}, | ||
dataUriLimit: 0, | ||
sourceMap: true, | ||
}, | ||
performance: { | ||
chunkSplit: {}, | ||
}, | ||
resolve: { | ||
alias: { | ||
src: '', | ||
}, | ||
}, | ||
})); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const getAny = () => { | ||
// constructable | ||
function anonymous() { | ||
return getAny(); | ||
} | ||
Object.defineProperties(anonymous, { | ||
length: { writable: true }, | ||
name: { writable: true }, | ||
}); | ||
return new Proxy(anonymous, { | ||
get(target, key) { | ||
if (key === Symbol.toPrimitive) return () => ''; | ||
return target[key] || (target[key] = getAny()); | ||
}, | ||
}); | ||
}; | ||
globalThis.chrome = globalThis.browser = new Proxy( | ||
{}, | ||
{ | ||
get() { | ||
return getAny(); | ||
}, | ||
}, | ||
); |
This file contains 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<!doctype html> | ||
<head> | ||
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no" /> | ||
</head> |
This file was deleted.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.