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

Manual: added importmap support #23371

Closed
wants to merge 44 commits into from
Closed

Manual: added importmap support #23371

wants to merge 44 commits into from

Conversation

ycw
Copy link
Contributor

@ycw ycw commented Jan 28, 2022

Related issue: #23363

  • added importmap in two files (here, there)

  • transform assets' path from abs to rel; asset includes script,link,iframe,img in manual//.html and manual//.js

  • iframe is sandboxed ( forbid export-to, and open-external, those buttons are noop, for now )

  • use es-module-shim shim-mode, no errors will be prompted.

Preview:

@mrdoob
Copy link
Owner

mrdoob commented Jan 28, 2022

Ops! Could you resolve the conflicts?

@ycw
Copy link
Contributor Author

ycw commented Jan 28, 2022

@mrdoob I'm not sure how to 455 conflicts..

@greggman
Copy link
Contributor

greggman commented Jan 29, 2022

A few comments:

  • There's no reason to sandbox these iframes. The only reason to sandbox iframes is because the page is a page you log into and/or contains user content. These pages are static HTML. The site is 100% in control of what goes in them

  • It's hard to see what all the changes are here but they don't handle the OffscreenCanvas article (https://ycw.github.io/three.js/manual/#en/offscreencanvas)

  • I'm confused at which direction this is going. It seems like it's reverting adding the import maps to the files in manual/examples.

  • If I try to run any of those examples on their own, they don't run. (eg: https://ycw.github.io/three.js/manual/examples/cameras-perspective.html).

  • If I click "open in a separate window" under any sample it fails to open

  • If I right click on "open in a separate window" and pick "open in a new tab" the url is wrong

  • As for the relative paths, I'd suggest if you want relative paths do that in a single PR, separate from all any other changes.

@ycw
Copy link
Contributor Author

ycw commented Jan 29, 2022

@mrdoob @greggman

There's no reason to sandbox these iframes. The only reason to sandbox iframes is because the page is a page you log into and/or contains user content. These pages are static HTML. The site is 100% in control of what goes in them

it seems a generated form is sent to external domains, true?

I'm confused at which direction this is going. It seems like it's reverting adding the import maps to the files in manual/examples.

import-maps is a draft, esms is influx, hard coding map and polyfill in many places is not a good idea for now.

If I try to run any of those examples on their own, they don't run.
.. If I click "open in a separate window" under any sample it fails to open
.. If I right click on "open in a separate window" and pick "open in a new tab" the url is wrong

I thought the examples are data files for the editor, the sources (html/css/js) have been clearly displayed in each pane. I'm not sure what the motivation of 'open in separate window'. ( wait..., is the popup window in sync with the editor in realtime? )

As for the relative paths, I'd suggest if you want relative paths do that in a single PR, separate from all any other changes.
It's hard to see what all the changes are here but they don't handle the OffscreenCanvas article

I agree, I might PR this.

@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 1, 2022

Closing. Please split up your changes into smaller PRs.

@Mugen87 Mugen87 closed this Feb 1, 2022
@ycw ycw deleted the manual-fix branch September 14, 2023 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants