Skip to content

buildOptimizer changes the behavior of openlayers #13097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
anthonn opened this issue Nov 29, 2018 · 4 comments
Closed

buildOptimizer changes the behavior of openlayers #13097

anthonn opened this issue Nov 29, 2018 · 4 comments

Comments

@anthonn
Copy link

anthonn commented Nov 29, 2018

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

node: v11.2.0
npm: 6.4.1
Angular CLI: 7.0.7
Node: 11.2.0
OS: win32 x64
Angular: 7.1.1
... common, compiler, core, forms, platform-browser
... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.10.7
@angular-devkit/build-angular 0.10.7
@angular-devkit/build-optimizer 0.10.7
@angular-devkit/build-webpack 0.10.7
@angular-devkit/core 7.0.7
@angular-devkit/schematics 7.0.7
@angular/cli 7.0.7
@angular/compiler-cli 7.0.4
@angular/language-service 7.0.4
@ngtools/webpack 7.0.7
@schematics/angular 7.0.7
@schematics/update 0.10.7
rxjs 6.3.3
typescript 3.1.6
webpack 4.19.1

Repro steps

please refer to the following issue in the link below.
In the bottom of the referenced issue there are test files supplied to be able to reproduce this behavior.

The log given by the failure

No errors are given, only wrong behavior.

Desired functionality

To have openlayers function in the same way with and without buildOptimizer turned on.

Misc

I do not know if this is a openlayers problem or a angular-cli problem. But I did originally post this issue for openlayers. Here is a link and a better description of what is happening:
openlayers/openlayers#9019

@ngbot ngbot bot added this to the needsTriage milestone Dec 3, 2018
@fbernhard
Copy link

@AnthonNilsson I would try to disable "pure_getters" and see if that helps. Check out the following issue thread for more information:

#11439

@anthonn
Copy link
Author

anthonn commented Dec 6, 2018

Looks like maybe the tree-shaking was removing some parts of the code related to adding basic projections for the coordinate systems.

By adding the import:
import { addCommon as addCommonProjections } from 'ol/proj';

and running the function
addCommonProjections();

the testproject started to work.

I'm still not sure though if this problem is an angular one or openlayers. If you do not feel it is related to angular code feel free to close this.

@clydin
Copy link
Member

clydin commented Dec 6, 2018

This is an issue with openlayers' use of the sideEffects option within its package.json. See this issue in its repository: openlayers/openlayers#8815. And also my associated comment here: #12760 (comment)

@clydin clydin closed this as completed Dec 6, 2018
@ngbot ngbot bot removed this from the needsTriage milestone Dec 6, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants