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

Add Teapot example that uses the new ES module bundle with importmap #5645

Merged
merged 8 commits into from
Jan 28, 2025

Conversation

vincentfretin
Copy link
Contributor

Description:

Add Teapot example that uses the new ES module bundle with importmap.

Changes proposed:

  • Add Teapot example (use importmap and import from three/addons)
  • Add the new ES module bundle and importmap example to the faq
  • Update super-three version in examples and docs in prerelease script
  • Create the aframe-v{nextVersion}.module.min.js / aframe.module.min.js bundle in prerelease script

{
"imports": {
"aframe": "../../../dist/aframe-master.module.min.js",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
Copy link
Member

Choose a reason for hiding this comment

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

Problem is that will have to update this in the future since it’s locked to r172. Is it possible to have an example without a hardcoded version?

Copy link
Contributor

Choose a reason for hiding this comment

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

It could be an option to tag the super-three versions with the A-Frame version they are used in, so you'd be able to use [email protected]. For master we could consider pointing it to node_modules instead of using a CDN? That way when checking out older revisions, running npm install ensures that the right super-three version is referenced.

Copy link
Member

Choose a reason for hiding this comment

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

yeah. pointing to node_modules sounds fine to me. trying to avoid small things that will eventually break and hard to keep track of over time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did you see my changes to the release script? There is no need to update manually, the script will update the super-three version in examples and docs similar to the aframe version.
But indeed for master that should reference the current version in node_modules. I just added an additional directory path to the webpack dev server config, and the preghpages script rewrite the url with the cdn.

@@ -157,6 +157,7 @@ <h2>Examples</h2>
<li><a href="boilerplate/3d-model/">3D Model (glTF)</a></li>
<li><a href="mixed-reality/anchor/">Anchor (Mixed Reality)</a></li>
<li><a href="mixed-reality/real-world-meshing/">Real World Meshing (Mixed Reality)</a></li>
<li><a href="boilerplate/teapot/">Teapot (use importmap and import from three/addons)</a></li>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it might be better to rename the example to importmap. The way I see it, it's an example of using importmap using a Teapot, instead of an example of a Teapot using importmaps.

Copy link
Member

Choose a reason for hiding this comment

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

yeah. boilerplate/importmap or boilerplate/modules. not sure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I renamed to boilerplate/importmap.

@vincentfretin
Copy link
Contributor Author

I did the changes. There is no manual changes needed to update url or version for super-three in development with webpack or when the docs are released, all is done via the preghpages and prerelease scripts.

@dmarcos
Copy link
Member

dmarcos commented Jan 28, 2025

Thank you!

@dmarcos dmarcos merged commit 72cc193 into aframevr:master Jan 28, 2025
3 checks passed
@vincentfretin vincentfretin deleted the add-teapot-example branch January 29, 2025 10:06
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.

3 participants