Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build using webpack #1828

Open
wants to merge 148 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
b4aa1c4
to src [pre]
tophf Sep 30, 2024
7fa95a1
WIP
tophf Sep 29, 2024
3912311
WIP split csslint+parserlib
tophf Oct 1, 2024
273bcda
WIP csslint
tophf Oct 1, 2024
28e25de
WIP
tophf Oct 1, 2024
a43535a
WIP
tophf Oct 2, 2024
692f39a
WIP rollup is bad at html and code splitting
tophf Oct 3, 2024
8a3dc11
WIP webpack (libraries)
tophf Oct 5, 2024
08813f2
WIP webpack (pages)
tophf Oct 6, 2024
17cf8c0
WIP webpack (failed splitting common chunk)
tophf Oct 7, 2024
82b5f2e
WIP webpack (done splitting common chunk)
tophf Oct 7, 2024
6e272f1
WIP webpack (done splitting common chunk) v2
tophf Oct 8, 2024
b30989e
WIP manage
tophf Oct 8, 2024
5051f52
bg prefs
tophf Oct 9, 2024
c005c2b
fix manage->render
tophf Oct 9, 2024
59f4fa2
fix manage->render + `?.`
tophf Oct 9, 2024
7311421
patch webpack `global`
tophf Oct 9, 2024
f7f8e73
skip reinjection
tophf Oct 9, 2024
2703261
load theme synchronously
tophf Oct 9, 2024
e9ee463
build jsonlint, remove /vendors
tophf Oct 9, 2024
5073162
clone $$ only when necessary
tophf Oct 9, 2024
d35e7a4
fix bg api & router
tophf Oct 9, 2024
62af62d
remove rollup config
tophf Oct 9, 2024
968b7ee
simplify isTab check
tophf Oct 9, 2024
af80803
fix openURL when non-tabbed window is active
tophf Oct 11, 2024
273a586
fix tests + webpack disk cache
tophf Oct 11, 2024
ae3bb88
fix tests v2 + update eslint
tophf Oct 11, 2024
7cea8de
fix github action: use node 20
tophf Oct 11, 2024
12b6b18
fix dynamic imports for cjs
tophf Oct 11, 2024
b6b7ae3
disable fs cache
tophf Oct 11, 2024
56b406f
import themer once
tophf Oct 11, 2024
a8621b8
enable ci build artifacts
tophf Oct 11, 2024
fea3cb9
fix editor settings listeners
tophf Oct 11, 2024
41832ae
disable ci build artifacts (webpack hangs)
tophf Oct 11, 2024
3becd89
fix window.bgReady and window.messageBox
tophf Oct 11, 2024
7784b69
export LZ_KEY separately
tophf Oct 11, 2024
8d7b392
fix `template` getter
tophf Oct 11, 2024
ce61f75
enable webpack fs cache and disable reports
tophf Oct 11, 2024
e0632a5
load ui files on demand
tophf Oct 11, 2024
7690f37
export section-util separately
tophf Oct 11, 2024
492f1df
load css only when needed
tophf Oct 11, 2024
ce1bf65
flatten search state
tophf Oct 11, 2024
0b75d25
fix unload guard
tophf Oct 12, 2024
a0db56f
fix auto-localization
tophf Oct 12, 2024
39e2e5b
use "Style manager" as title
tophf Oct 12, 2024
0bda951
simplify $create, $toFragment, tNodeList
tophf Oct 12, 2024
023ae05
reuse hasOwn
tophf Oct 12, 2024
f5af8f1
make zips
tophf Oct 13, 2024
abce7cd
patch transitions in Chrome which is still affected
tophf Oct 15, 2024
40cb2b1
MV3 WIP
tophf Oct 16, 2024
0fb70f6
MV3 WIP2
tophf Oct 17, 2024
02e1073
save the customized part of linter config
tophf Oct 17, 2024
e8f8559
export URLS and UA separately
tophf Oct 17, 2024
3ee8e64
fix import-via-drop
tophf Oct 17, 2024
cd51301
simplify URLS.supported + inline URLS.configureCommands
tophf Oct 17, 2024
eb74870
MV3 WIP: get data synchronously in own pages
tophf Oct 17, 2024
4e29b00
restore simplified prefs.ready
tophf Oct 17, 2024
e3e5014
WIP SharedWorker, add isDark to clientData URL
tophf Oct 20, 2024
6b3efcc
WIP download via fetch()
tophf Oct 20, 2024
9e4eb44
WIP sync
tophf Oct 21, 2024
c6bcd5e
WIP sync p2
tophf Oct 22, 2024
c06e619
WIP sync p3
tophf Oct 22, 2024
ff7405a
WIP sessionData
tophf Oct 24, 2024
a73b6a5
fix webpack config
tophf Oct 24, 2024
2b1407e
fix preinjection
tophf Oct 24, 2024
64b250d
fix wrapper on libs without exports
tophf Oct 24, 2024
d86f6ea
scatter dom and toolbox
tophf Oct 24, 2024
16d956c
fix navman conditions
tophf Oct 25, 2024
062b518
fix port comms
tophf Oct 25, 2024
abf9e69
fix usw publish/disconnect
tophf Oct 25, 2024
37d391a
fix spinner animation
tophf Oct 25, 2024
2e1f0cc
add DNR debug log
tophf Oct 25, 2024
b9bf185
fix tests
tophf Oct 25, 2024
4b9b664
throttle chromeSync on error
tophf Oct 25, 2024
aa03aa3
use safeTimeout in SW
tophf Oct 27, 2024
757a041
fix eslint no-use-before-define
tophf Oct 27, 2024
c84465a
webpack progress in `zip` + fix RawEnv
tophf Oct 27, 2024
00b8551
use keepAlive for chromeSync
tophf Oct 27, 2024
7bdc6ee
simplify clientData param
tophf Oct 27, 2024
8fdce97
fix debounce and module order
tophf Oct 27, 2024
7f1f394
ci: use nodejs verion from package.json
tophf Oct 27, 2024
af9459b
fix Chrome detection in MV3
tophf Oct 28, 2024
03dad2d
save the state in IndexedDB
tophf Oct 28, 2024
341b636
treeshaking for unused modules
tophf Oct 28, 2024
06b8100
fix clientData bgReady and popup
tophf Oct 29, 2024
d113a11
fix keepAlive
tophf Oct 29, 2024
8a5df50
set class="mobile" on <html>
tophf Oct 29, 2024
c45024d
reorganize folders: sw, icon, css, js
tophf Oct 29, 2024
338bf59
add keepAlive option + fix raciness
tophf Oct 30, 2024
9f25254
detect possible FOUC + sort vars - isTab
tophf Oct 30, 2024
46a0492
reuse setClientData in MV2
tophf Oct 30, 2024
dbdbab3
implement xhrInject and patchCSP for MV3
tophf Oct 30, 2024
1122a8a
reuse setClientData in MV2 p2
tophf Oct 30, 2024
6b7c2b1
fix word breaking and html in tooltips
tophf Oct 30, 2024
9328adc
fix data-clickable detector
tophf Oct 30, 2024
b3bfe0e
fix usercss redirection
tophf Oct 30, 2024
d948eb7
use real id in WRB note
tophf Oct 30, 2024
41d5130
avoid soft hyphens after punctuation
tophf Oct 30, 2024
27d113f
fix and simplify context-menus
tophf Oct 30, 2024
bb7591f
fix preloadPopupData when styles are off
tophf Oct 30, 2024
e4ef83f
fix target blank for links in i18n
tophf Oct 30, 2024
2bf98ff
remove patcher info as it seems abandoned
tophf Oct 30, 2024
81b379a
fix keepAlive
tophf Oct 31, 2024
803676d
popup: simplify UI for disableAll and buttons
tophf Oct 31, 2024
c098053
restore installer UI translation
tophf Nov 1, 2024
1520c65
use_dynamic_url is bugged in Chrome
tophf Nov 1, 2024
a4ecdb2
add FOUC info
tophf Nov 1, 2024
06a8710
use tBody properly in popup
tophf Nov 1, 2024
6b0f447
use DNR for XHR
tophf Nov 1, 2024
0eca8f3
make master switch status clickable
tophf Nov 1, 2024
aba3e71
limit onRuleMatchedDebug to DEBUG builds
tophf Nov 2, 2024
dc71cf8
don't wake up on tab close/open
tophf Nov 2, 2024
f594c7c
fix lock tracking
tophf Nov 2, 2024
5b5f509
fix popup data in Vivaldi
tophf Nov 2, 2024
ca3c0e6
fix write as usercss without template
tophf Nov 2, 2024
5109646
don't mangle exports
tophf Nov 2, 2024
5265d0b
simplify devtools->edit redirect
tophf Nov 2, 2024
8445b5c
fix state db
tophf Nov 3, 2024
6c3ccc8
track tab removed via onbeforeunload
tophf Nov 3, 2024
ec135d6
fix context menus + eslint warnings
tophf Nov 4, 2024
043635e
keepAlive 0 by default to conform to webstore
tophf Nov 4, 2024
ead160a
don't wake up on main_frame unload
tophf Nov 4, 2024
0825376
faster db startup in Firefox
tophf Nov 5, 2024
1426680
inline consts.js
tophf Nov 5, 2024
ce03a9e
fix patchCSP option
tophf Nov 5, 2024
97bd9d3
fix reload command
tophf Nov 5, 2024
42278e6
ignore bfcache error
tophf Nov 5, 2024
0b3664c
fix and simplify FF detection in own pages
tophf Nov 6, 2024
638e1a1
don't broadcast backgroundReady in MV3
tophf Nov 6, 2024
f723266
build beta as MV3
tophf Nov 6, 2024
cc965ce
re-inject after toggling in MV3
tophf Nov 6, 2024
6bf3827
retry chrome.sync on error
tophf Nov 7, 2024
7c205b9
simplify API: use one-time sendMessage
tophf Nov 7, 2024
5248fc8
fix bfcache port
tophf Nov 8, 2024
b32a8a9
fix popup on unsupported urls
tophf Nov 8, 2024
a556b88
fix BUILD checks
tophf Nov 9, 2024
44fd70c
fix #1836: ensure buttons fit in the popup
tophf Nov 9, 2024
38192a3
update preset-env
tophf Nov 9, 2024
a6a46b0
fix MV2 build
tophf Nov 9, 2024
4696b20
fix scrollbar in options for Chrome < 72
tophf Nov 10, 2024
e3d05d8
fix direct API invocation in MV2
tophf Nov 10, 2024
ff3a374
fix clientData in MV3
tophf Nov 10, 2024
ad427ad
fix leaky Promise.race
tophf Nov 10, 2024
4a99404
resolve a todo, extract ownId
tophf Nov 11, 2024
6664a50
use bgReady._deps
tophf Nov 13, 2024
706d48b
reuse db connection, faster universal xxxMany
tophf Nov 13, 2024
1a33db9
fix #1837: use a fake redirect_uri for chrome.identity
tophf Nov 13, 2024
14c330d
3.0.1 fix lz observation
tophf Nov 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

253 changes: 0 additions & 253 deletions .eslintrc.yml

This file was deleted.

14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
node-version: '>=20.6.0'
- run: npm install
- run: npm test

# - run: npm run build
#
# - name: Get REV
# id: rev
# run: echo "REV=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
#
# - uses: actions/upload-artifact@v4
# with:
# name: 'Stylus-test-${{ steps.rev.outputs.REV }}'
# path: 'dist/*'
# if-no-files-found: error
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
*.zip
*.tmp*
.DS_Store
.eslintcache
.vscode
desktop.ini
dist/
node_modules/
yarn.lock
/.eslintcache
/.vscode
/.*.html
/dist*/
/node_modules/
/yarn.lock
16 changes: 0 additions & 16 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ The zip file includes all the files from the repository **except**:
* `package.json` file.
* `package-lock.json` and/or `yarn.lock` file(s).

<!-- FIXME: is this statement still true?
* `vendor/codemirror/lib` files. This path is excluded because it contains a file modified for development purposes only. Instead, the CodeMirror files are copied directly from `node_modules/codemirror/lib`.
-->

## Tag a release/Bump the version

Use the `npm version (major | minor | patch)` command to tag a release.
Expand All @@ -56,15 +52,3 @@ To push files to Transifex:
```
npm run update-transifex
```

## 3rd-party libraries

3rd-party libraries are managed by `npm`. Since Stylus is built with vanilla JS, we only use libraries that can run in the browser.

We keep a copy of these libraries inside the `vendor` directory so users can side-load this repository without executing the build script. These files are downloaded from CDN or pulled from npm (`node_modules`).

To add/update a library to the latest version, run `npm install PACKAGE_NAME@latest`.

To remove a library, run `npm uninstall PACKAGE_NAME`.

After the (un)installation, specify files which should be copied in `tools/build-vendor.js` and run `npm run build-vendor` to rebuild the vendor folder.
28 changes: 28 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
'use strict';

const {getBrowserlist} = require('./tools/util');

module.exports = {
targets: getBrowserlist(),
assumptions: {
constantReexports: true,
noDocumentAll: true,
noIncompleteNsImportDetection: true,
noNewArrows: true,
objectRestNoSymbols: true,
privateFieldsAsSymbols: true,
},
presets: [
['@babel/preset-env', {
useBuiltIns: false,
bugfixes: true,
loose: true,
modules: false,
}],
],
plugins: [
// ['babel-plugin-inline-constants', {modules: ['./src/js/consts.js']}],
// '@babel/plugin-transform-runtime',
// ['transform-modern-regexp', {useRe: true}], // TODO: use for complex regexps
],
};
26 changes: 0 additions & 26 deletions background/background-worker.js

This file was deleted.

Loading
Loading