Skip to content

Commit

Permalink
Merge pull request #1367 from sveltejs/gh-1316
Browse files Browse the repository at this point in the history
refactor
  • Loading branch information
Rich-Harris committed Apr 29, 2018
2 parents a7c1c38 + 01c3558 commit 2616ab1
Show file tree
Hide file tree
Showing 165 changed files with 2,952 additions and 3,296 deletions.
34 changes: 14 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
.DS_Store
node_modules
compiler
ssr
shared.js
scratch
!test/compiler
!test/ssr
.nyc_output
coverage
coverage.lcov
test/sourcemaps/samples/*/output.js
test/sourcemaps/samples/*/output.js.map
_actual.*
_actual-v2.*
_actual-bundle.*
src/generators/dom/shared.ts
package-lock.json
.idea/
*.iml
store.umd.js
yarn-error.log
node_modules
/compiler/
/ssr/
/shared.js
/scratch/
/coverage/
/coverage.lcov/
/test/sourcemaps/samples/*/output.js
/test/sourcemaps/samples/*/output.js.map
/src/compile/shared.ts
/package-lock.json
/store.umd.js
/yarn-error.log
_actual*.*
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default [

/* ssr/register.js */
{
input: 'src/server-side-rendering/register.js',
input: 'src/ssr/register.js',
plugins: [
resolve(),
commonjs(),
Expand Down
10 changes: 5 additions & 5 deletions src/Stats.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Node, Warning } from './interfaces';
import Generator from './generators/Generator';
import Compiler from './compile/Compiler';

const now = (typeof process !== 'undefined' && process.hrtime)
? () => {
Expand Down Expand Up @@ -73,12 +73,12 @@ export default class Stats {
this.currentChildren = this.currentTiming ? this.currentTiming.children : this.timings;
}

render(generator: Generator) {
render(compiler: Compiler) {
const timings = Object.assign({
total: now() - this.startTime
}, collapseTimings(this.timings));

const imports = generator.imports.map(node => {
const imports = compiler.imports.map(node => {
return {
source: node.source.value,
specifiers: node.specifiers.map(specifier => {
Expand All @@ -95,8 +95,8 @@ export default class Stats {
});

const hooks: Record<string, boolean> = {};
if (generator.templateProperties.oncreate) hooks.oncreate = true;
if (generator.templateProperties.ondestroy) hooks.ondestroy = true;
if (compiler.templateProperties.oncreate) hooks.oncreate = true;
if (compiler.templateProperties.ondestroy) hooks.ondestroy = true;

return {
timings,
Expand Down
Loading

0 comments on commit 2616ab1

Please sign in to comment.