Skip to content

Commit

Permalink
fix(shadow-dom): prevent slot leak (#678)
Browse files Browse the repository at this point in the history
* Revert "fix(typings): fix IStaticResourceConfig typings"

This reverts commit ea994d1.

* fix(typings): fix IStaticResourceConfig typings

* refactor(typings): enhance typings for viewslot/shadow dom

* fix(imports): use correct location

* refactor(view-compiler): use static inject() instead of @Inject to workaround test setup issue

* chore(deps): update dependencies for moving to webpack from jspm

* chore(test): prepare infra for testing with webpack

* chore(test): add basic shadow dom integration tests

* chore(tests): enhance shadow dom emulation tests

* chore(tests): enhance shadow dom tests

* fix(shadow-dom): ensure tracked projected node are untracked

* refactor(tests): accept .ts in tests, change shadow dom test to .ts

* fix(typings): stricter typings for ShadowDOM.distributeView

* refactor(tests): remove redudant ./setup import

* chore(deps): upgrade gulp-typescript to v3

* chore(clean): remove jspm config.js

* chore(clean): clean unused deps, update readme

* chore(ci): dont use jspm

* chore(ci): dont use jspm

* chore(build): fix doc task

* chore(lint): remove trailing spaces, disable a line
  • Loading branch information
bigopon authored and EisenbergEffect committed Jan 24, 2020
1 parent e5d516a commit 9241dca
Show file tree
Hide file tree
Showing 31 changed files with 11,250 additions and 8,396 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ orbs:
workflows:
main:
jobs:
- v1/build_test
- v1/build_test:
use_jspm: false
- v1/build_merge:
<<: *filter_only_develop
use_jspm: false
requires:
- v1/build_test
- v1/npm_publish:
Expand Down
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,17 @@ To build the code, follow these steps.

To run the unit tests, first ensure that you have followed the steps above in order to install all dependencies and successfully build the library. Once you have done that, proceed with these additional steps:

1. Ensure that [jspm](http://jspm.io/) is installed. If you need to install it, use the following commnand:
1. You can now run the tests with this command:

```shell
npm install -g jspm
npm run test
```
2. Install the client-side dependencies with jspm:

You can optionally run either of the following:
```shell
jspm install
npm run test:watch
# OR
npm run test:debugger
```

3. You can now run the tests with this command:

```shell
npm run test
```
to have better development experience, with watch/debuging capabilities
8 changes: 7 additions & 1 deletion build/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,13 @@ compileToModules.forEach(function(moduleType){

gulp.task('build-dts', function() {
var tsProject = ts.createProject(
compilerTsOptions({ removeComments: false, target: "es2015", module: "es2015" }), ts.reporter.defaultReporter());
compilerTsOptions({
removeComments: false,
target: "es2015",
module: "es2015",
emitDeclarationOnly: true
}),
ts.reporter.defaultReporter());
var tsResult = srcForTypeScript().pipe(ts(tsProject));
return tsResult.dts
.pipe(gulp.dest(paths.output));
Expand Down
3 changes: 2 additions & 1 deletion build/tasks/doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ gulp.task('doc-generate', function(){
mode: 'modules',
excludeExternals: true,
ignoreCompilerErrorsfalse,
versiontrue
versiontrue,
exclude: 'jasmine'
}));
});

Expand Down
116 changes: 0 additions & 116 deletions config.js

This file was deleted.

139 changes: 80 additions & 59 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,77 +1,98 @@
// Karma configuration
// Generated on Fri Dec 05 2014 16:49:29 GMT-0500 (EST)
const path = require('path');
const { AureliaPlugin } = require('aurelia-webpack-plugin');

module.exports =
/**
*
* @param {import('karma').Config} config
*/
function(config) {
const browsers = config.browsers;

module.exports = function(config) {
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jspm', 'jasmine'],

jspm: {
// Edit this to your needs
loadFiles: ['src/**/*.js', 'test/setup.js', 'test/**/*.js']
},


// list of files / patterns to load in the browser
files: [],


// list of files to exclude
exclude: [
frameworks: ['jasmine'],
files: [
'test/setup.js'
],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'test/**/*.js': ['babel'],
'src/**/*.js': ['babel']
'test/setup.js': ['webpack', 'sourcemap']
},
'babelPreprocessor': {
options: {
sourceMap: 'inline',
presets: [ 'es2015-loose', 'stage-1'],
plugins: [
'syntax-flow',
'transform-decorators-legacy',
'transform-flow-strip-types'
webpack: {
mode: 'development',
entry: '',
resolve: {
extensions: [".ts", ".js"],
modules: ["node_modules"],
alias: {
src: path.resolve(__dirname, 'src'),
// aliasing to this in test folder, instead of src folder
// to avoid colliding with the legacy build script
'aurelia-templating': path.resolve(__dirname, 'test/aurelia-templating'),
test: path.resolve(__dirname, 'test')
}
},
performance: {
hints: false,
},
devtool: Array.isArray(browsers) && browsers.includes('ChromeDebugging') ? 'eval-source-map' : 'inline-source-map',
module: {
rules: [
{
test: /\.[jt]s$/,
use: [
{
loader: "babel-loader",
options: {
presets: [
'@babel/preset-typescript',
'@babel/preset-env'
],
plugins: [
['@babel/plugin-transform-typescript', { allExtensions: true }],
["@babel/plugin-transform-runtime", { regenerator: true }],
["@babel/plugin-proposal-decorators", { legacy: true }],
["@babel/plugin-proposal-class-properties", { loose: true }]
]
},
}
],
exclude: /node_modules/
}
]
}
},
plugins: [
new AureliaPlugin({
aureliaApp: undefined,
noWebpackLoader: true
})
]
},

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
mime: {
"text/x-typescript": ["ts"]
},
logLevel: config.LOG_ERROR, // to disable the WARN 404 for image requests
reporters: ['progress'],


// web server port
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome'],

webpackServer: { noInfo: true },
browsers: Array.isArray(browsers) && browsers.length > 0 ? browsers : ['ChromeHeadless'],
customLaunchers: {
ChromeDebugging: {
base: 'Chrome',
flags: [
'--remote-debugging-port=9333'
],
debug: true
}
},
mochaReporter: {
ignoreSkipped: true
},

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
Expand Down
Loading

0 comments on commit 9241dca

Please sign in to comment.