-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix gulp integration and server so that it can work with mjs files #30292
fix gulp integration and server so that it can work with mjs files #30292
Conversation
0f5ae48
to
ce5d37c
Compare
c40812e
to
d3751c2
Compare
d3751c2
to
65a1295
Compare
@caroqliu adding you as i would love to get typescript feedback! |
65a1295
to
3a4f275
Compare
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.
Thanks for thinking of me to do a review, left a few comments
build-system/server/new-server/transforms/utilities/option-set.ts
Outdated
Show resolved
Hide resolved
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.
Agree with a lot of the comments left. Thanks for getting this done!
ae9fc35
to
e87eee7
Compare
b7d113f
to
bc02e4d
Compare
Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>
Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>
76bc7ae
to
74e4680
Compare
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.
A couple comments below. LGTM after they are addressed.
return `node .\\node_modules\\typescript\\lib\\tsc.js -p ${SERVER_TRANSFORM_PATH.split( | ||
'/' | ||
).join(pathModule.sep)}${pathModule.sep}tsconfig.json`; |
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.
I think it might be possible to replace this split / join block with a path.posix
method.
/cc @samouri, who has experience with this, and the vagaries of Windows.
if (result.status != 0) { | ||
const err = new Error('Could not build AMP Dev Server'); | ||
err.showStack = false; | ||
err.showStack = true; |
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 reason this was false
in the first place was because the message in err
contained the useful info, while the stack contained a very verbose and mostly useless nodejs callstack. Has any of this changed? (If yes, you can delete this line, since the default is true. If not, I'd suggest reverting this line.)
…mpproject#30292) * make it so that src transformation only happens strictly in scripts/script-transform.ts each module should do 1 thing and 1 thing only. currently the module transformer also did a src/url transformation. this caused weird mismatches when they are ran together. - added looseScriptSrcCheck to allow for non cdn domains. This will allow us to transition from the bad fixture files to having all html files be valid AMP HTML by default. * temp * temp * fix imports * add transform back to integration * fix html * fix integration * temp * temp * make transformers have a loose mode to be more forgiving on script src * add more tests and fix bug for extention retention * allow for mjs files to be served by the test server * add glob to load mjs files in karma server * lint fixes * lint html * break up this PR * fix bad error formatting * apply recs * Update build-system/server/new-server/transforms/transform.ts Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com> * Update build-system/server/new-server/transforms/utilities/option-set.ts Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com> * fix other locations of "FORTESTING" * fix esm and non esm tests to be green * use writeFileSync instead of async method. seems to be a race * guarantee directory exists first * fix windows issues * skip failing IE test temporarily * applied recs * apply more recs * temporarily read from testing version.txt * temp "only" * dont reroute to max json files * change error to warning * fix max builds and integration tests against max files * revert testing changes. we'll separete it into its own PR Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>
To make gulp integration work cleanly with mjs files we transform the fixtures/* html files to the module script during
gulp integration --esm
.fixes:
type="application/json"
feature adds:
Related PR(s):
#30378 (add mjs server routes)
#28336 (turn on esm tests)