Skip to content

Commit 9fd7b8c

Browse files
authored
Mangle (#312)
* user terser for compression * load new min bundle in extension * fixes state leak * use module * fixes leaky ref
1 parent b5d0170 commit 9fd7b8c

8 files changed

Lines changed: 164 additions & 54 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
.DS_Store
22
node_modules/
33
app/bundle.js
4+
app/bundle.min.js
45
app/bundle.css
5-
extension/toolbar/bundle.js
6+
extension/toolbar/bundle.min.js
67
extension/toolbar/bundle.css
78
extension/build
89
extension/tuts

app/features/color.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import $ from 'blingblingjs'
22
import { TinyColor } from '@ctrl/tinycolor'
33
import { getStyle } from '../utilities/'
44

5+
const state = {
6+
active_color: 'background',
7+
elements: [],
8+
}
9+
510
export function ColorPicker(pallete, selectorEngine) {
611
const foregroundPicker = $('#foreground', pallete)
712
const backgroundPicker = $('#background', pallete)

app/features/selectable.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,12 +600,11 @@ export function Selectable(visbug) {
600600

601601
$(label).on('query', ({detail}) => {
602602
if (!detail.text) return
603-
this.query_text = detail.text
604603

605604
queryPage('[data-pseudo-select]', el =>
606605
el.removeAttribute('data-pseudo-select'))
607606

608-
queryPage(this.query_text + ':not([data-selected])', el =>
607+
queryPage(detail.text + ':not([data-selected])', el =>
609608
detail.activator === 'mouseenter'
610609
? el.setAttribute('data-pseudo-select', true)
611610
: select(el))

app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,6 @@ <h2 style="font-size: 3rem; color: green; text-shadow: 0 2px 4px red; font-weigh
744744

745745
</main>
746746

747-
<script src="bundle.js" defer></script>
747+
<script src="bundle.js" type="module" defer></script>
748748
</body>
749749
</html>

extension/visbug.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const toggleIn = ({id:tab_id}) => {
2222
else {
2323
chrome.tabs.insertCSS(tab_id, { file: 'toolbar/bundle.css' })
2424
chrome.tabs.executeScript(tab_id, { file: 'web-components.polyfill.js' })
25-
chrome.tabs.executeScript(tab_id, { file: 'toolbar/bundle.js' })
25+
chrome.tabs.executeScript(tab_id, { file: 'toolbar/bundle.min.js' })
2626
chrome.tabs.executeScript(tab_id, { file: 'toolbar/inject.js' })
2727

2828
state.loaded[tab_id] = true

0 commit comments

Comments
 (0)