Skip to content

Commit

Permalink
load dev-mode code from source code comments (removed by minification)
Browse files Browse the repository at this point in the history
 - change the dev mode detection: remove 'is bundled' check, add 'is minified' check
 - remove dev mode code loading from HTML imports / ES modules / etc
 - add dev mode code loading from source code comments
 - started a new major (2.0.0)
  • Loading branch information
Viktor Lukashov committed Jul 18, 2018
1 parent 1873961 commit f9def48
Show file tree
Hide file tree
Showing 8 changed files with 12,591 additions and 194 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
bower_components
test/build
build
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ Utility method for detecting that an application using Vaadin Elements is runnin
There are no automatic tests as the functionality depends on the host the code is run on (localhost vs others) and the bundling status.

To verify functionality:
1. Run `npm install`
1. Run `bower install`
1. Run `cd test && bower install ; cd ..`
1. Run `polyserve -H 0.0.0.0`
1. Open http://localhost:8080/test/index.html
1. Run `npm start`
1. Open http://localhost:8081/test/index.html
1. Verify that `mode` is `development` (green)
1. Verify that `importIfDevelopmentMode` is `imported` (green)
1. Open http://`<yourip>`:8080/test/index.html
1. Verify that `importIfDevelopmentMode` is `run` (green)
1. Open http://`<yourip>`:8081/test/index.html
1. Verify that `mode` is `production` (orange)
1. Verify that `importIfDevelopmentMode` is `ignored` (orange)
1. Run `cd test/bower_components && ln -s ../../vaadin-development-mode-detector.html && cd .. && polymer build --bundle`
1. Open http://localhost:8080/test/build/default/index.html
1. Run `npm run start:prod`
1. Open http://localhost:8081/test/index.html
1. Verify that `mode` is `production` (orange)
1. Verify that `importIfDevelopmentMode` is `ignored` (orange)
1. Open http://`<yourip>`:8080/test/build/default/index.html
1. Open http://`<yourip>`:8081/test/index.html
1. Verify that `mode` is `production` (orange)
1. Verify that `importIfDevelopmentMode` is `ignored` (orange)
3 changes: 0 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@
},
"devDependencies": {
"webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0"
},
"resolutions": {
"polymer": "^2.0.0"
}
}
Loading

0 comments on commit f9def48

Please sign in to comment.