This website requires JavaScript.
Explore
Help
Sign In
Sakurai
/
pdf.js
Watch
1
Star
0
Fork
0
You've already forked pdf.js
Code
Issues
Pull Requests
Packages
Projects
Releases
Wiki
Activity
2a68724b53
pdf.js
/
external
/
builder
/
fixtures_esprima
/
comments-expected.js
18 lines
141 B
JavaScript
Raw
Normal View
History
Unescape
Escape
Adds esprima-based preprocessor.
2016-05-11 08:05:29 +09:00
function
f1
(
)
{
Replace the webpack+acorn transform with a Babel plugin This commit converts the pdfjsdev-loader transform into a Babel plugin, to skip a AST->string->AST round-trip. Before this commit, the webpack build process was: 1. Babel parses the code 2. Babel transforms the AST 3. Babel generates the code 4. Acorn parses the code 5. pdfjsdev-loader transforms the AST 6. @javascript-obfuscator/escodegen generates the code 7. Webpack parses the file 8. Webpack concatenates the files After this commit, it is reduced to: 1. Babel parses the code 2. Babel transforms the AST 3. babel-plugin-pdfjs-preprocessor transforms the AST 4. Babel generates the code 5. Webpack parses the file 6. Webpack concatenates the files This change improves the build time by ~25% (tested on MacBook Air M2): - `gulp lib`: 3.4s to 2.6s - `gulp dist`: 36s to 29s - `gulp generic`: 5.5s to 4.0s - `gulp mozcentral`: 4.7s to 3.2s The new Babel plugin doesn't support the `saveComments` option of pdfjsdev-loader, and it just always discards comments. Even though pdfjsdev-loader supported multiple values for that option, it was effectively ignored due to `acorn` dropping comments by default.
2024-01-23 02:33:31 +09:00
"1"
;
"2"
;
Adds esprima-based preprocessor.
2016-05-11 08:05:29 +09:00
}
function
f2
(
)
{
Replace the webpack+acorn transform with a Babel plugin This commit converts the pdfjsdev-loader transform into a Babel plugin, to skip a AST->string->AST round-trip. Before this commit, the webpack build process was: 1. Babel parses the code 2. Babel transforms the AST 3. Babel generates the code 4. Acorn parses the code 5. pdfjsdev-loader transforms the AST 6. @javascript-obfuscator/escodegen generates the code 7. Webpack parses the file 8. Webpack concatenates the files After this commit, it is reduced to: 1. Babel parses the code 2. Babel transforms the AST 3. babel-plugin-pdfjs-preprocessor transforms the AST 4. Babel generates the code 5. Webpack parses the file 6. Webpack concatenates the files This change improves the build time by ~25% (tested on MacBook Air M2): - `gulp lib`: 3.4s to 2.6s - `gulp dist`: 36s to 29s - `gulp generic`: 5.5s to 4.0s - `gulp mozcentral`: 4.7s to 3.2s The new Babel plugin doesn't support the `saveComments` option of pdfjsdev-loader, and it just always discards comments. Even though pdfjsdev-loader supported multiple values for that option, it was effectively ignored due to `acorn` dropping comments by default.
2024-01-23 02:33:31 +09:00
"1"
;
"2"
;
Adds esprima-based preprocessor.
2016-05-11 08:05:29 +09:00
}
Fix duplicated function name in the Esprima fixtures This makes `gulp externaltest` work again. It looks like this wasn't validated before, but is now after recent package updates.
2018-08-25 23:23:20 +09:00
function
f3
(
)
{
Replace the webpack+acorn transform with a Babel plugin This commit converts the pdfjsdev-loader transform into a Babel plugin, to skip a AST->string->AST round-trip. Before this commit, the webpack build process was: 1. Babel parses the code 2. Babel transforms the AST 3. Babel generates the code 4. Acorn parses the code 5. pdfjsdev-loader transforms the AST 6. @javascript-obfuscator/escodegen generates the code 7. Webpack parses the file 8. Webpack concatenates the files After this commit, it is reduced to: 1. Babel parses the code 2. Babel transforms the AST 3. babel-plugin-pdfjs-preprocessor transforms the AST 4. Babel generates the code 5. Webpack parses the file 6. Webpack concatenates the files This change improves the build time by ~25% (tested on MacBook Air M2): - `gulp lib`: 3.4s to 2.6s - `gulp dist`: 36s to 29s - `gulp generic`: 5.5s to 4.0s - `gulp mozcentral`: 4.7s to 3.2s The new Babel plugin doesn't support the `saveComments` option of pdfjsdev-loader, and it just always discards comments. Even though pdfjsdev-loader supported multiple values for that option, it was effectively ignored due to `acorn` dropping comments by default.
2024-01-23 02:33:31 +09:00
if
(
"1"
)
{
"1"
;
}
"2"
;
if
(
"3"
)
{
"4"
;
}
Adds esprima-based preprocessor.
2016-05-11 08:05:29 +09:00
}
Reference in New Issue
Copy Permalink