Skip to content
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

Fix Angular Universal support #1554

Closed

Conversation

laurentgoudet
Copy link

@laurentgoudet laurentgoudet commented Nov 27, 2018

Fixes #1052.

@codecov
Copy link

codecov bot commented Nov 27, 2018

Codecov Report

Merging #1554 into master will decrease coverage by 0.11%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1554      +/-   ##
==========================================
- Coverage   28.99%   28.87%   -0.12%     
==========================================
  Files          32       32              
  Lines        1452     1458       +6     
  Branches      197      199       +2     
==========================================
  Hits          421      421              
- Misses       1029     1035       +6     
  Partials        2        2
Impacted Files Coverage Δ
packages/core/core.module.ts 0% <0%> (ø) ⬆️
packages/core/directives/map.ts 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e8f1ab...43a26e0. Read the comment docs.

@gregor-srdic
Copy link

Please merge if it works :)

@kadosh1000
Copy link

Waiting for this merge as well. Please merge so we can use it with universal

@sebholstein
Copy link
Owner

@laurentgoudet thanks for the work. this looks promising. I will review it shortly

Copy link
Owner

@sebholstein sebholstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review done

super();
this._config = config || {};
this._windowRef = w;
this._documentRef = d;
}

load(): Promise<void> {
if (!isPlatformBrowser(this.platformId)) {
// The code is running on the server, skip
return Promise.resolve();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When someone uses the loader, this would crash on the server side (because the code will assume that the google maps api is loaded) - I think we don't need a change here and a notice in a "running AGM with in universal" apps would be better

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another note: we need this change in the agm-map component (this would also prevent the loading in most of the use cases)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, moving the logic to the map component is much cleaner

packages/core/tsconfig.json Show resolved Hide resolved
rollup.core.config.js Show resolved Hide resolved
@sebholstein
Copy link
Owner

Also: can you remove the added submodule? Submodule PrestaShop added at 0fa9f2

@laurentgoudet
Copy link
Author

Also: can you remove the added submodule? Submodule PrestaShop added at 0fa9f2

Oops my bad, fixed

@jota12x
Copy link

jota12x commented Dec 4, 2018

I encountered this problem a couple of days ago as well. Hoping that the merge goes well 👍

@simkepal
Copy link

Hi,

What is the status of this pull request?

Thank you!

@ld-gary
Copy link

ld-gary commented Jan 1, 2019

Hey all, when can we expect this merge to be completed and the issue to be resolved?

@DineshChopra
Copy link

DineshChopra commented Jan 9, 2019

Hi All, I am using js-marker-cluster, Its working fine for me, But server side rendering is not working,
So any idea by when we can expect those server side rendering related changes?
Thanks in advance :)

@stale
Copy link

stale bot commented Apr 9, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 9, 2019
@pamo
Copy link

pamo commented Apr 9, 2019

Anything we can do to help get this merged in and released?

@stale stale bot removed the stale label Apr 9, 2019
@marcus-sa
Copy link

How's the progress coming along?

@terencehonles
Copy link
Contributor

Is this superseded by #1634 or is there still things that are needed for universal support?

@mehrad-rafigh
Copy link

@terencehonles No that PR did not fix any Universal related issues. We have been forced to fork this library and patch map.ts to make it work with server-side rendering.
I am happy to provide a PR to address this :)

@terencehonles
Copy link
Contributor

terencehonles commented Aug 22, 2019

@mehrad-rafigh there's been more activity lately so I'd create a new PR if this one is stale and you have a fix

@mehrad-rafigh
Copy link

Hi @terencehonles

Surely, I will do that. I was just hoping the Author of the PR would update this and get merged :D
I will take a look, if my patch can be applied without any further changes and open a PR. Hopefully sometime in the upcoming week

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Angular 4 Universal - SyntaxError: Unexpected token export