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

Added a polyserve option doNotCompile and speed up WCT tests #168

Closed
wants to merge 3 commits into from

Conversation

usergenic
Copy link
Contributor

--do-not-compile/ doNotCompile = Array of glob string patterns to match against request url paths in polyserve to skip babelCompile middleware. WCT uses this to specify NOT to compile the /components/web-component-tester/browser.js file to speed tests up.

…lude /components/web-component-tester/browser.js
@@ -69,6 +71,11 @@ export function babelCompile(
if (isPolyfill.test(request.url)) {
return false;
}
if (doNotCompile.length > 0 &&
!!doNotCompile.find((p) => minimatch(request.url, p))) {
console.log('SKIPPY MA-DOO-DAH',request.url);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

@@ -36,6 +36,14 @@ export const args: ArgDescriptor[] = [
type: String,
defaultValue: 'auto',
},
{
name: 'do-not-compile',
description: 'Disables compilation for file(s) matching given pattern. ' +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we clarify what we mean by compilation? As currently written, it bypasses ES5 compilation, but also name-to-path transformation and AMD transformation. compile-middleware is already probably too aggressive in this regard, since the compile=never returns false from shouldTransform in the same way.

@@ -36,6 +36,14 @@ export const args: ArgDescriptor[] = [
type: String,
defaultValue: 'auto',
},
{
name: 'do-not-compile',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we have --compile and --do-not-compile, which might be slightly confusing. I guess we should just document the interaction between the two, especially that this takes precedence over --compile=always?

(I was also thinking we could update the --compile flag to take glob patterns (and minimatch already supports the ! operator), but then you still have the auto vs always difference that needs to be represented somehow. Not sure if this idea makes sense.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible alternate names:

  • --pass-thru
  • --do-not-modify
  • --serve-as-is
  • --as-is
  • --no-transform
  • --no-rewrite
  • --immutable
  • --static
  • --constant
  • --invariant

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But do we want to disable all the transforms, or is this just about ES5 compilation?

@aomarks
Copy link
Member

aomarks commented May 1, 2018

Are we still going to do this? Can close PR otherwise?

@usergenic
Copy link
Contributor Author

Closing PR because not important right now and this is rotting on the vine.

@usergenic usergenic closed this May 3, 2018
justinfagnani pushed a commit that referenced this pull request Jul 10, 2018
tslib is a peer dependency of ix, so adding to dependencies, since ix is used in code (not just in dev/test)
@stramel stramel mentioned this pull request Jan 3, 2019
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants