Skip to content

Commit

Permalink
0.6.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
JayCanuck committed Feb 22, 2017
2 parents ddd092e + 0a4527c commit f84973a
Show file tree
Hide file tree
Showing 16 changed files with 139 additions and 88 deletions.
33 changes: 29 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,41 @@
## 0.6.0 (February 22, 2017)

All enact-dev dependencies have been updated to latest applicable revisions. If you are using editor-based linting, please update your global dependencies to match.

### create

* Template updated for Enact 1.0.0-beta.3 and React 15.4.2.

### pack

* Transitioned from the iLib-loader to a new iLibPlugin with enhanced support for compilation-unique caching in Enact 1.0.0-beta.3. This is *not* backward compatible; please update to Enact 1.0.0-beta.3 or use an earlier release of enact-dev.
* Supports code splitting/lazy-loading via ES6 `import()` syntax (limited to static string values).
* WebOSMetaPlugin updated to support dynamicalling adding `usePrerendering:true` to appinfo.json files as needed.

### test

* Added Map polyfill support
* Fixes a code interaction issue with WebOSMetaPlugin that caused tests to fail.

### lint

* Enact ESLint plugin updated to support `handlers` block in `kind(). Also adds propType validation for props used by handler and computed functions.
* Enact ESLint config updated to replace deprecated `babel/array-bracket-spacing` with `array-bracket-spacing`.
* Additional options may be passed to the lint command.

## 0.5.1 (January 27, 2017)

## create
### create

* Template updated for Enact 1.0.0-beta.2 and React 15.4.2.
* Template's .gitignore file now correctly includes `dist`.

## pack
### pack

* Added a `node` Enact build option to support polyfilling NodeJS components. See [here](https://github.com/enyojs/enact-dev/blob/master/README.md#enact-build-options) for more info.
* All localized appinfo.json resources and assets will now be correctly copied to the output directory.

# test
### test

* Added a polyfill for String.prototype.repeat, as phantomjs lacks the API.
* Webpack build warnings will no longer spam the console in certain scenarios.
Expand Down Expand Up @@ -139,4 +164,4 @@ Several additional documentation files have been added to the `docs` directory,

## 0.1.0 (September 29, 2016)

* Initial internal release
* Initial internal release
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ You would need to install an ESLint plugin for your editor first.
Then, you will need to install some packages *globally*:

```sh
npm install -g enyojs/eslint-config-enact eslint-plugin-react eslint-plugin-babel babel-eslint

npm install -g eslint eslint-plugin-react eslint-plugin-babel babel-eslint enyojs/eslint-plugin-enact enyojs/eslint-config-enact
```

We recognize that this is suboptimal, but it is currently required due to the way we hide the ESLint dependency. The ESLint team is already [working on a solution to this](https://github.com/eslint/eslint/issues/3458) so this may become unnecessary in a couple of months.
2 changes: 1 addition & 1 deletion config/.babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"presets": ["es2015", "stage-0", "react"],
"plugins": ["dev-expression"],
"plugins": ["dev-expression", "dynamic-import-webpack"],
"env": {
"production": {
"plugins": ["transform-react-inline-elements","transform-react-constant-elements"]
Expand Down
9 changes: 5 additions & 4 deletions config/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var autoprefixer = require('autoprefixer');
var LessPluginRi = require('resolution-independence');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var GracefulFsPlugin = require('graceful-fs-webpack-plugin');
var WebOSMetaPlugin = require('webos-meta-webpack-plugin');
var ILibPlugin = require('ilib-webpack-plugin');
var CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');

function readJSON(file) {
Expand All @@ -29,6 +29,7 @@ module.exports = function(karma) {
files: [
require.resolve('./polyfills'),
require.resolve('string.prototype.repeat'),
require.resolve('es6-map/implement'),
require.resolve('./proptype-checker'),
'./!(node_modules|dist|build)/**/*-specs.js'
],
Expand All @@ -38,6 +39,7 @@ module.exports = function(karma) {
'./!(node_modules|dist|build)/**/*.js': ['webpack'],
[require.resolve('./polyfills')]: ['webpack'],
[require.resolve('string.prototype.repeat')]: ['webpack'],
[require.resolve('es6-map/implement')]: ['webpack'],
[require.resolve('./proptype-checker')]: ['webpack']
},

Expand Down Expand Up @@ -96,8 +98,7 @@ module.exports = function(karma) {
{test: /\.(c|le)ss$/, loader: ExtractTextPlugin.extract('style',
'css?-autoprefixer&modules&sourceMap&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!less?sourceMap')
},
{test: /ilibmanifest\.json$/, loader: 'ilib?noSave'},
{test: /\.json$/, loader: 'json', exclude: /ilibmanifest\.json$/},
{test: /\.json$/, loader: 'json'},
{test: /\.(ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2)(\?.*)?$/, loader: 'file',
query: {
name: '[path][name].[ext]'
Expand Down Expand Up @@ -128,7 +129,7 @@ module.exports = function(karma) {
new ExtractTextPlugin('[name].css'),
new CaseSensitivePathsPlugin(),
new GracefulFsPlugin(),
new WebOSMetaPlugin()
new ILibPlugin({create: false})
]
},

Expand Down
13 changes: 6 additions & 7 deletions config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var LessPluginRi = require('resolution-independence');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var GracefulFsPlugin = require('graceful-fs-webpack-plugin');
var ILibPlugin = require('ilib-webpack-plugin');
var WebOSMetaPlugin = require('webos-meta-webpack-plugin');
var CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
var WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
Expand Down Expand Up @@ -145,17 +146,11 @@ module.exports = {
'css?-autoprefixer&modules&sourceMap&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!less?sourceMap')
// Note: this won't work without `new ExtractTextPlugin()` in `plugins`.
},
// Support importing ilib bundles.
{
test: /ilibmanifest\.json$/,
loader: 'ilib'
},
// JSON is not enabled by default in Webpack but both Node and Browserify
// allow it implicitly so we also enable it.
{
test: /\.json$/,
loader: 'json',
exclude: /ilibmanifest\.json$/
loader: 'json'
},
// "file" loader makes sure those assets get copied during build
// When you `import` an asset, you get its output filename.
Expand Down Expand Up @@ -248,6 +243,10 @@ module.exports = {
// EMFILE errors when hanndling mass amounts of files at once, such as
// what happens when using ilib bundles/resources.
new GracefulFsPlugin(),
// Automatically configure iLib library within @enact/i18n. Additionally,
// ensure the locale data files and the resource files are copied during
// the build to the output directory.
new ILibPlugin(),
// Automatically detect ./appinfo.json and ./webos-meta/appinfo.json files,
// and parses any to copy over any webOS meta assets at build time.
new WebOSMetaPlugin()
Expand Down
13 changes: 6 additions & 7 deletions config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var LessPluginRi = require('resolution-independence');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var GracefulFsPlugin = require('graceful-fs-webpack-plugin');
var ILibPlugin = require('ilib-webpack-plugin');
var WebOSMetaPlugin = require('webos-meta-webpack-plugin');

function readJSON(file) {
Expand Down Expand Up @@ -130,17 +131,11 @@ module.exports = {
'css?-autoprefixer&modules&importLoaders=1!postcss!less')
// Note: this won't work without `new ExtractTextPlugin()` in `plugins`.
},
// Support importing ilib bundles.
{
test: /ilibmanifest\.json$/,
loader: 'ilib'
},
// JSON is not enabled by default in Webpack but both Node and Browserify
// allow it implicitly so we also enable it.
{
test: /\.json$/,
loader: 'json',
exclude: /ilibmanifest\.json$/
loader: 'json'
},
// "file" loader makes sure those assets get copied during build
// When you `import` an asset, you get its output filename.
Expand Down Expand Up @@ -246,6 +241,10 @@ module.exports = {
// EMFILE errors when hanndling mass amounts of files at once, such as
// what happens when using ilib bundles/resources.
new GracefulFsPlugin(),
// Automatically configure iLib library within @enact/i18n. Additionally,
// ensure the locale data files and the resource files are copied during
// the build to the output directory.
new ILibPlugin(),
// Automatically detect ./appinfo.json and ./webos-meta/appinfo.json files,
// and parses any to copy over any webOS meta assets at build time.
new WebOSMetaPlugin()
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: enact-dev
title: enact-dev Command Line Tool
---

The enact-dev package includes the following documentation:
The enact-dev package provides a command-line tool for creating and building Enact applications. The following sections describe its installation and use:

* [Installation](./installation.md)
* [Starting a New App](./starting-a-new-app.md)
Expand Down
14 changes: 9 additions & 5 deletions global-cli/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,29 @@ function displayHelp() {
process.exit(0);
}

module.exports = function(args) {
module.exports = function (args) {
var opts = minimist(args, {
boolean: ['l', 'local', 's', 'strict', 'f', 'framework', 'h', 'help'],
alias: {l:'local', s:'strict', f:'framework', h:'help'}
});
opts.help && displayHelp();

var eslintArgs = [];
if(opts.strict || opts.framework) {
if (opts.strict || opts.framework) {
eslintArgs.push('--no-eslintrc', '--config', require.resolve('eslint-config-enact/strict'));
} else if(!opts.local) {
} else if (!opts.local) {
eslintArgs.push('--no-eslintrc', '--config', require.resolve('eslint-config-enact'));
}
eslintArgs.push('--ignore-pattern', 'node_modules/*');
eslintArgs.push('--ignore-pattern', 'build/*');
eslintArgs.push('--ignore-pattern', 'dist/*');
eslintArgs.push(opts._[0] || '.');
if (opts._.length) {
eslintArgs = eslintArgs.concat(opts._);
} else {
eslintArgs.push('.');
}
var child = cp.fork(require.resolve('eslint/bin/eslint'), eslintArgs, {env:process.env, cwd:process.cwd()});
child.on('close', function(code, signal) {
child.on('close', function (code, signal) {
process.exit(code);
});
};
9 changes: 0 additions & 9 deletions global-cli/modifiers/externals.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ var
EnactFrameworkRefPlugin = require('./util/EnactFrameworkRefPlugin');

module.exports = function(config, opts) {
var resBundle = './resources/ilibmanifest.json';
if(!exists(resBundle)) {
if(!exists('./resources')) {
fs.mkdirSync('./resources');
}
fs.writeFileSync(resBundle, JSON.stringify({files:[]}, null, '\t'), {encoding:'utf8'});
}
config.entry.main.splice(config.entry.main.length-1, 0, resBundle);

// Add the reference plugin so the app uses the external framework
config.plugins.push(new EnactFrameworkRefPlugin({
name: 'enact_framework',
Expand Down
9 changes: 5 additions & 4 deletions global-cli/modifiers/framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ module.exports = function(config, opts) {
config.output.library = 'enact_framework';
config.output.libraryTarget = 'umd';

// Append additional options to the ilib-loader to skip './resources' detection/generation
var ilibLoader = helper.getLoaderByName(config, 'ilib');
if(ilibLoader) {
ilibLoader.loader += '?noResources';
// Modify the iLib plugin options to skip './resources' detection/generation
var ilibPlugin = helper.getPluginByName(config, 'ILibPlugin');
if(ilibPlugin) {
ilibPlugin.options.create = false;
ilibPlugin.options.resources = false;
}

// Remove the HTML generation plugin and webOS-meta plugin
Expand Down
2 changes: 1 addition & 1 deletion global-cli/modifiers/isomorphic.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = function(config, opts) {
}
// Prepend react-dom as top level entrypoint so espose-loader will expose
// it to window.ReactDOM to allow runtime rendering of the app.
config.entry.main.unshift(reactDOM);
config.entry.main.splice(-1, 0, reactDOM);

// Expose the 'react-dom' on a global context for App's rendering
// Currently maps the toolset to window.ReactDOM.
Expand Down
9 changes: 9 additions & 0 deletions global-cli/modifiers/snapshot.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var
path = require('path'),
fs = require('fs'),
exists = require('path-exists').sync,
helper = require('./util/config-helper'),
SnapshotPlugin = require('./util/SnapshotPlugin');

Expand All @@ -12,6 +13,14 @@ module.exports = function(config, opts) {
htmlPlugin.options.snapshot = true;
}

// fallback alias for fbjs in Node 4.x dependency tree
var fbjs = path.join(process.cwd(), 'node_modules', 'react', 'node_modules', 'fbjs');
if(exists(fbjs)) {
config.resolve.alias.fbjs = fbjs;
}
// Snapshot helper API for the transition from v8 snapshot into the window
config.entry.main.splice(-1, 0, require.resolve('./util/snapshot-helper'));

// Expose iLib locale utility function module so we can update the locale on page load, if used
var babel = helper.findLoader(config, 'babel');
config.module.loaders.splice((babel>=0 ? babel : 0), 0, {
Expand Down
7 changes: 5 additions & 2 deletions global-cli/modifiers/util/html-template-isomorphic.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<body>
<div id="root"></div>
<script type="text/javascript">
requestAnimationFrame(function(){
window.onload = function() { setTimeout(function() {
<% if(!htmlWebpackPlugin.options.snapshot) { %>
var count = 0;
var appendScripts = function(js) {
Expand Down Expand Up @@ -60,6 +60,9 @@
};
appendScripts(<%= JSON.stringify(htmlWebpackPlugin.files.js || []) %>);
<% } else { %>
if(typeof updateEnvironment === 'function') {
updateEnvironment();
}
if(typeof iLibLocale === 'object') {
iLibLocale.updateLocale();
}
Expand All @@ -69,7 +72,7 @@
console.log('ERROR: Snapshot app not found');
}
<% } %>
});
}, 0); };
</script>

</body>
Expand Down
18 changes: 18 additions & 0 deletions global-cli/modifiers/util/snapshot-helper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* snapshot-helper.js
*
* Since the initial ExecutionEnvironment is set during snapshot creation, we need to provide an API
* to update environment on window load.
*
*/

global.updateEnvironment = function() {
var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);

ExecutionEnvironment.canUseDOM = canUseDOM;
ExecutionEnvironment.canUseWorkers = typeof Worker !== 'undefined';
ExecutionEnvironment.canUseEventListeners = canUseDOM && !!(window.addEventListener || window.attachEvent);
ExecutionEnvironment.canUseViewport = canUseDOM && !!window.screen;
ExecutionEnvironment.isInWorker = !canUseDOM; // For now, this is true - might change in the future.
};
Loading

0 comments on commit f84973a

Please sign in to comment.