-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(all): prepare release 2.0.0-rc.3
- Loading branch information
1 parent
457ee6f
commit 37a05b5
Showing
13 changed files
with
119 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// This plugins tries to detect @inlineView('<template>...</template>') and process its dependencies | ||
// like HtmlDependenciesPlugin does. | ||
const BaseIncludePlugin_1 = require("./BaseIncludePlugin"); | ||
const BasicEvaluatedExpression = require("webpack/lib/BasicEvaluatedExpression"); | ||
const htmlLoader = require("./html-requires-loader"); | ||
class InlineViewDependenciesPlugin extends BaseIncludePlugin_1.BaseIncludePlugin { | ||
parser(compilation, parser, add) { | ||
// The parser will only apply "call inlineView" on free variables. | ||
// So we must first trick it into thinking inlineView is an unbound identifier | ||
// in the various situations where it is not. | ||
// This covers native ES module, for example: | ||
// import { inlineView } from "aurelia-framework"; | ||
// inlineView("<template>"); | ||
parser.plugin("evaluate Identifier imported var", (expr) => { | ||
if (expr.name === "inlineView") { | ||
return new BasicEvaluatedExpression().setIdentifier("inlineView").setRange(expr.range); | ||
} | ||
return undefined; | ||
}); | ||
// This covers commonjs modules, for example: | ||
// const _aurelia = require("aurelia-framework"); | ||
// _aurelia.inlineView("<template>"); | ||
// Or (note: no renaming supported): | ||
// const inlineView = require("aurelia-framework").inlineView; | ||
// inlineView("<template>"); | ||
parser.plugin("evaluate MemberExpression", (expr) => { | ||
if (expr.property.name === "inlineView") { | ||
return new BasicEvaluatedExpression().setIdentifier("inlineView").setRange(expr.range); | ||
} | ||
return undefined; | ||
}); | ||
parser.plugin("call inlineView", (expr) => { | ||
if (expr.arguments.length !== 1) | ||
return; | ||
let arg1 = expr.arguments[0]; | ||
let param1 = parser.evaluateExpression(arg1); | ||
if (!param1.isString()) | ||
return; | ||
let modules; | ||
try { | ||
modules = htmlLoader.modules(param1.string); | ||
} | ||
catch (e) { | ||
return; | ||
} | ||
modules.forEach(add); | ||
}); | ||
} | ||
} | ||
exports.InlineViewDependenciesPlugin = InlineViewDependenciesPlugin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { BaseIncludePlugin, AddDependency } from "./BaseIncludePlugin"; | ||
export declare class InlineViewDependenciesPlugin extends BaseIncludePlugin { | ||
parser(compilation: Webpack.Compilation, parser: Webpack.Parser, add: AddDependency): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters