-
Notifications
You must be signed in to change notification settings - Fork 310
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
Switch to ESModule #372
Switch to ESModule #372
Conversation
12482c8
to
353f03a
Compare
787f1d2
to
319e9d4
Compare
8536f68
to
a6760a1
Compare
a6760a1
to
e36b4ce
Compare
e36b4ce
to
ed90c06
Compare
0daf88b
to
a46d5e0
Compare
a46d5e0
to
f602450
Compare
@guanbinrui hi! can you help me to find why the E2E test failed? |
Failed to open the browser. I think the |
@guanbinrui it's moved to temp/extension |
38c668f
to
eec7c56
Compare
This PR is ready for review! @guanbinrui please help me to fix the E2E test thanks! Also, please run this branch in the watch mode and try to modify |
e829e84
to
b666016
Compare
29ea54f
to
0e32341
Compare
"build:e2e": "gulp build --e2e", | ||
"build:firefox": "gulp build --fx", | ||
"build:gecko": "gulp build --android", | ||
"build:ios": "gulp build --ios", | ||
"compile:contracts": "./scripts/contracts.sh", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the task not migrate?
ef75082
to
3f682dc
Compare
* WARNING: THIS FILE IS GENERATED. DO NOT MODIFY IT. | ||
* https://github.com/mozilla/web-ext/issues/1986 | ||
*/ | ||
declare module 'web-ext' { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extract to a common library?
@dimensiondev/types
6fded17
to
7e94a57
Compare
⚠⚠⚠ I've decided not to merge this due to bad DX ⚠⚠⚠
⚠⚠⚠ Don't delete this branch ⚠⚠⚠
close #221
The new architecture of Maskbook
TL;DR
With our new architecture, you can...
import.meta
import()
in any way you wantprocess.env.*
gulp watch-esm
orgulp watch-assets
).webext
toolchainrequire()
__webpack_public_path__
process.env.NODE_ENV
Caution about these things!
JSON
file is supported, but not encouraged, please load the JSON file byfetch
when possible.JSON
file that imported byexample.ts
, you need to changeexample.ts
to recompile it because the JSON files are inlined toexample.ts
.temp
folder before the build because old files are not removed.tsc
in this project! Runttsc
instead!webext
toolchain is not migrated to the new toolchain yet! That means you cannot automatically install this on Android. I'll try to add it later.Under the hood
Compile time
We now use
gulp
as our build tool. Usegulp --tasks
to see what tasks are available.Source codes (
./src/
) are compiled by the TypeScript compiler directly to emit ES Module files.All dependencies (
./node_modules/
) are compiled by Webpack and served as a global variable__deps__
. (In future we will migrate some torollup
andsnowpack
).Web Workers are compiled by Webpack.
The injected script is compiled by Webpack.
We use TypeScript incremental build to speed up build time.
Runtime
To land this...
What's next?
./public/
folder to where they are be used and load them byimport.meta