Compare commits

..

5 Commits

Author SHA1 Message Date
ahocevar
349e602ee5 Update package version to 5.0.3 2018-07-11 11:01:34 +02:00
ahocevar
9cb10efe4b Changelog for v5.0.3 2018-07-11 10:56:05 +02:00
Andreas Hocevar
871a283601 Merge pull request #8364 from ahocevar/ie-examples
Make examples work in IE11
2018-07-11 10:51:08 +02:00
Andreas Hocevar
d1a609e0a3 Merge pull request #8363 from ahocevar/package-json-autogenerate
Autogenerate src/ol/package.json
2018-07-11 10:49:43 +02:00
Andreas Hocevar
e0c5529878 Merge pull request #8371 from ahocevar/empty-replay-groups
Skip rendering when there is no replay group
2018-07-11 10:47:42 +02:00
10 changed files with 65 additions and 55 deletions

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@
/dist/
node_modules/
src/index.js
src/ol/package.json

9
changelog/v5.0.3.md Normal file
View File

@@ -0,0 +1,9 @@
# 5.0.3
The v5.0.3 fixes a regression in the vector tile renderer and improves the built examples and release package.
## Fixes
* [#8364](https://github.com/openlayers/openlayers/pull/8364) - Make examples work in IE11 ([@ahocevar](https://github.com/ahocevar))
* [#8363](https://github.com/openlayers/openlayers/pull/8363) - Autogenerate src/ol/package.json ([@ahocevar](https://github.com/ahocevar))
* [#8371](https://github.com/openlayers/openlayers/pull/8371) - Skip rendering when there is no replay group ([@ahocevar](https://github.com/ahocevar))

View File

@@ -18,6 +18,18 @@ module.exports = {
context: src,
target: 'web',
entry: entry,
module: {
rules: [{
use: {
loader: 'buble-loader'
},
test: /\.js$/,
include: [
path.join(__dirname, '..', '..', 'src'),
path.join(__dirname, '..')
]
}]
},
optimization: {
runtimeChunk: {
name: 'common'

View File

@@ -64,20 +64,20 @@ function createWordIndex(exampleData) {
/**
* Gets the source for the chunk that matches the jsPath
* @param {Object} chunk Chunk.
* @param {string} jsPath Path of the file.
* @param {string} jsName Name of the file.
* @return {string} The source.
*/
function getJsSource(chunk, jsPath) {
function getJsSource(chunk, jsName) {
let jsSource;
for (let i = 0, ii = chunk.modules.length; i < ii; ++i) {
const module = chunk.modules[i];
if (module.modules) {
jsSource = getJsSource(module, jsPath);
jsSource = getJsSource(module, jsName);
if (jsSource) {
return jsSource;
}
}
if (module.identifier == jsPath) {
if (module.identifier.endsWith(jsName)) {
return module.source;
}
}
@@ -151,8 +151,7 @@ ExampleBuilder.prototype.render = async function(dir, chunk) {
// add in script tag
const jsName = `${name}.js`;
const jsPath = path.join(dir, jsName);
let jsSource = getJsSource(chunk, jsPath);
let jsSource = getJsSource(chunk, path.join('.', jsName));
jsSource = jsSource.replace(/'\.\.\/src\//g, '\'');
if (data.cloak) {
for (const entry of data.cloak) {

View File

@@ -1,6 +1,6 @@
{
"name": "openlayers",
"version": "5.0.2",
"version": "5.0.3",
"description": "OpenLayers mapping library",
"keywords": [
"map",
@@ -16,9 +16,9 @@
"serve-examples": "webpack-dev-server --config examples/webpack/config.js --mode development --watch",
"build-examples": "webpack --config examples/webpack/config.js --mode production",
"build-index": "node tasks/generate-index",
"set-version": "node tasks/set-version",
"prebuild": "npm run set-version && npm run build-index",
"prepare": "npm run set-version",
"prepare-package": "node tasks/prepare-package",
"prebuild": "npm run prepare-package && npm run build-index",
"prepare": "npm run prepare-package",
"build": "rollup --config config/rollup.js && cleancss --source-map src/ol/ol.css -o build/ol.css",
"presrc-closure": "npm run prebuild",
"src-closure": "node tasks/transform-types",
@@ -35,10 +35,6 @@
"bugs": {
"url": "https://github.com/openlayers/openlayers/issues"
},
"browser": "dist/ol.js",
"style": [
"css/ol.css"
],
"dependencies": {
"pbf": "3.1.0",
"pixelworks": "1.1.0",
@@ -47,6 +43,7 @@
"devDependencies": {
"babel-core": "^6.26.3",
"babel-plugin-jsdoc-closure": "1.5.1",
"buble-loader": "^0.5.1",
"chaikin-smooth": "^1.0.4",
"clean-css-cli": "4.1.11",
"copy-webpack-plugin": "^4.4.1",
@@ -86,8 +83,8 @@
"uglifyjs-webpack-plugin": "^1.2.5",
"url-polyfill": "^1.0.13",
"walk": "^2.3.9",
"webpack": "4.12.1",
"webpack-cli": "^3.0.3",
"webpack": "4.15.1",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.4"
},
"eslintConfig": {

View File

@@ -1,14 +0,0 @@
{
"name": "ol",
"version": "5.0.2",
"description": "OpenLayers mapping library",
"main": "index.js",
"module": "index.js",
"license": "BSD-2-Clause",
"dependencies": {
"pbf": "3.1.0",
"pixelworks": "1.1.0",
"rbush": "2.0.2"
},
"sideEffects": "false"
}

View File

@@ -392,7 +392,9 @@ CanvasVectorTileLayerRenderer.prototype.postCompose = function(context, frameSta
continue;
}
const replayGroup = sourceTile.getReplayGroup(layer, tileCoord.toString());
if (renderMode != VectorTileRenderType.VECTOR && !replayGroup.hasReplays(replayTypes)) {
if (!replayGroup || !replayGroup.hasReplays(replayTypes)) {
// sourceTile was not yet loaded when this.createReplayGroup_() was
// called, or it has no replays of the types we want to render
continue;
}
if (!transform) {

View File

@@ -52,4 +52,4 @@ export function getUid(obj) {
* OpenLayers version.
* @type {string}
*/
export const VERSION = '5.0.2';
export const VERSION = '5.0.3';

27
tasks/prepare-package.js Normal file
View File

@@ -0,0 +1,27 @@
const fs = require('fs');
const path = require('path');
const pkg = require('../package.json');
const util = require.resolve('../src/ol/util');
const lines = fs.readFileSync(util, 'utf-8').split('\n');
const versionRegEx = /const VERSION = '(.*)';$/;
for (let i = 0, ii = lines.length; i < ii; ++i) {
const line = lines[i];
if (versionRegEx.test(line)) {
lines[i] = line.replace(versionRegEx, `const VERSION = '${pkg.version}';`);
break;
}
}
fs.writeFileSync(util, lines.join('\n'), 'utf-8');
const src = path.join('src', 'ol');
const packageJson = path.resolve(__dirname, path.join('..', src, 'package.json'));
delete pkg.scripts;
delete pkg.devDependencies;
delete pkg.style;
delete pkg.eslintConfig;
const main = path.posix.relative(src, require.resolve(path.join('..', pkg.main)));
pkg.main = pkg.module = main;
pkg.name = 'ol';
fs.writeFileSync(packageJson, JSON.stringify(pkg, null, 2), 'utf-8');

View File

@@ -1,23 +0,0 @@
const fs = require('fs');
const pkg = require('../package.json');
const index = require.resolve('../src/ol/util');
const lines = fs.readFileSync(index, 'utf-8').split('\n');
const versionRegEx = /const VERSION = '(.*)';$/;
for (let i = 0, ii = lines.length; i < ii; ++i) {
const line = lines[i];
if (versionRegEx.test(line)) {
lines[i] = line.replace(versionRegEx, `const VERSION = '${pkg.version}';`);
break;
}
}
const packageJson = require.resolve('../src/ol/package.json');
const packageJsonObj = JSON.parse(fs.readFileSync(packageJson, 'utf-8'));
packageJsonObj.version = pkg.version;
fs.writeFileSync(packageJson, JSON.stringify(packageJsonObj, null, 2), 'utf-8');
fs.writeFileSync(index, lines.join('\n'), 'utf-8');