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

Support for SSR #4981

Closed
AlekseiKhariukov opened this issue Jul 3, 2024 · 2 comments · Fixed by #5183
Closed

Support for SSR #4981

AlekseiKhariukov opened this issue Jul 3, 2024 · 2 comments · Fixed by #5183
Assignees
Labels
feature request phase III Team G Test Cases Written Test cases has been written for that issue

Comments

@AlekseiKhariukov
Copy link
Collaborator

AlekseiKhariukov commented Jul 3, 2024

Background
It is impossible to use ketcher in SSR applications because of errors. The reason is that ketcher uses browser APIs, such a "window" object, which are not supported on server side.

Solution
Create example of SSR application which uses ketcher (similar what we have in /example folder). Wrap all usages of unsupported APIs into conditions to exclude it from execution on server side. Probably better option is to wrap the initialisation code to have this check in one place only.

Additional context
It was found that Raphaeljs library(used for render in molecules mode) uses window object.

@accmeboot accmeboot self-assigned this Jul 12, 2024
accmeboot pushed a commit that referenced this issue Jul 22, 2024
@AlexeyGirin AlexeyGirin added the Test Cases Written Test cases has been written for that issue label Jul 25, 2024
@AlexeyGirin
Copy link
Collaborator

No test cases needed for that issue

accmeboot pushed a commit that referenced this issue Jul 29, 2024
accmeboot pushed a commit that referenced this issue Jul 29, 2024
accmeboot pushed a commit that referenced this issue Jul 30, 2024
@accmeboot accmeboot linked a pull request Jul 30, 2024 that will close this issue
9 tasks
rrodionov91 pushed a commit that referenced this issue Aug 1, 2024
- example-ssr created
- example-ssr window error fix & hydration fix

---------

Co-authored-by: Mikhail Vialov <mikhail_vialov@epam.com>
@AlexeyGirin
Copy link
Collaborator

Verified verbally.

  • Ketcher Version 2.24.0-rc.1 Build at 2024-08-06; 19:17:47
  • Indigo Toolkit Version 1.23.0-rc.1.0-g85f89b8f5-wasm32-wasm-clang-19.0.0
  • Windows 10 Pro
  • Chrome Version 127.0.6533.100 (Official Build) (64-bit)

Guch1g0v pushed a commit that referenced this issue Oct 17, 2024
- example-ssr created
- example-ssr window error fix & hydration fix

---------

Co-authored-by: Mikhail Vialov <mikhail_vialov@epam.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request phase III Team G Test Cases Written Test cases has been written for that issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants