-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
parcel uses js modules in the build when the target browser is FF48 #8783
Comments
But there's also a |
hmm I see it now. Yeah I expect only that. Since FF 48 does not support modules so why bother building a module and having both module in nomodule in index.html? Edit: Not sure but I my build seems to be working. I also see two |
Also it seems parcel is using the WASM bundle of a dependency instead of asm.js:
|
There is another problem:
FF48 does not support AbortController. Should I open another issue? Or perhaps both are the same issue that the code is not getting transpiled for FF48. |
What Parcel (and most other tools) do is rewriting new syntax into old syntax, and potentially polyfilling globals from the standard library (using https://github.com/zloirock/core-js). This is meant by "transpiling". Adding other global objects, such as And same goes for Wasm, which could in theory be transpiled to asmjs but I'm not aware of any bundler doing this automatically (both because it's not trivial and because it's not really worth it anymore as Wasm is pretty well supported by now). |
What is difference between
How can I tell parcel to transpile WASM to asm.js? Or is it the job for some other tool? |
That one is specified in the DOM API spec, not the JS spec itself: https://dom.spec.whatwg.org/#interface-abortcontroller
Parcel doesn't do this. |
Okay but still the problem that parcel puts |
It's not a "problem" because the nomodule script also exists and will work for old browsers. When you specify Firefox 48, you're really telling parcel the minimum browser version to support. More modern browsers will use the module version. |
Yeah you are right. But I want exactly FF48 not at least FF48. What should I do? |
There is no way to do that. Firefox 48 is almost 7 years old. Why would you only want to target that and nothing else? |
Sorry for the late reply. I am writing an app for KaiOS. KaiOS 2.x is based on Gecko from FF48. KaiOS 3.x however, is based on a recent one. Edit: Is there a way to disable module thing entirely? |
bump |
If you use HTML as an entry, then |
Can you provide an example config? I've done so and it doesn't produce a HTML file anymore: {
"name": "chooj",
"version": "0.0.0",
"description": "Matrix client for KaiOS",
"private": true,
"scripts": {
"build": "rm -rf build && parcel build --dist-dir build --no-source-maps --detailed-report 12",
"devbuild": "rm -rf build && parcel build --no-optimize --dist-dir build",
"clean": "yarn run clean:parcel",
"serve": "yarn run devbuild && serve ./build",
"clean:parcel": "rm -rf .parcel-cache build",
"lint": "yarn eslint src"
},
"author": "Farooq Karimi Zadeh",
"license": "GPLv3+",
"dependencies": {
"KaiUI": "git+https://github.com/farooqkz/KaiUIv2.git",
"abortcontroller-polyfill": "^1.7.5",
"classnames": "^2.3.1",
"core-js": "^3.26.1",
"inferno": "^8.0.4",
"inferno-dev-utils": "^6.0.4",
"inferno-extras": "^8.0.0",
"jsqr": "^1.4.0",
"localforage": "^1.10.0",
"matrix-js-sdk": "^23.0.0",
"prettier": "^2.8.4",
"xmimetype": "^1.1.1"
},
"devDependencies": {
"@babel/core": "^7.12.0",
"@babel/plugin-transform-modules-commonjs": "^7.19.6",
"@parcel/transformer-babel": "^2.8.2",
"@parcel/transformer-sass": "^2.8.2",
"babel-plugin-inferno": "^6.5.0",
"buffer": "^5.5.0",
"crypto-browserify": "^3.12.0",
"eslint": "5.x",
"eslint-config-inferno-app": "^7.0.2",
"eslint-plugin-import": "2.x",
"eslint-plugin-inferno": "^7",
"eslint-plugin-jsx-a11y": "6.x",
"parcel": "^2.8.2",
"postcss": "^8.2.1",
"postcss-modules": "^4.3.0",
"process": "^0.11.10",
"serve": "^14.1.2",
"stream-browserify": "^3.0.0",
"util": "^0.12.3"
},
"browserslist": "Firefox 48",
"targets": {
"default": {
"source": [
"src/index.js",
"src/manifest.webapp",
"src/sw.js",
"src/chooj.png"
],
"outputFormat": "global"
}
}
} |
run only "parcel", in dist/index.html will rm <script type="module">; |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. |
🐛 bug report
I target FF48 for my webapp and have specified it as browserslist in
package.json
but the resulting build uses Javascript modules which is unsupported by this version of Firefox.🎛 Configuration (.babelrc, package.json, cli command)
🤔 Expected Behavior
It must not use Javascript modules
😯 Current Behavior
The resulting index.html uses JS modules:
🔦 Context
I'm using parcel in chooj which is a Matrix client for KaiOS. KaiOS 2.x uses Gecko version used in Firefox 48.
💻 Code Sample
https://github.com/farooqkz/chooj
🌍 Your Environment
The text was updated successfully, but these errors were encountered: