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

Update demo to use flat API #1382

Open
wants to merge 3 commits into
base: V3
Choose a base branch
from
Open

Update demo to use flat API #1382

wants to merge 3 commits into from

Conversation

hpb-htw
Copy link
Contributor

@hpb-htw hpb-htw commented Feb 21, 2025

All Submissions:

  • Use V3 API in utils/regl-renderer/{demo.html,demo.es.html}

  • symlink modling/dist/jscad-modeling.es.js to utils/regl-renderer/jscad-modeling.es.js

  • Move Modeling in both demo.html and demo.es.html into a separated JS file model

  • Have you followed the guidelines in our Contributing document?

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

  • Does your submission pass tests?

Note: please do NOT include build files (those generate by the build-xxx commands) with your PR,

Thank you for your help in advance, much appreciated !

Copy link
Member

@z3dev z3dev left a comment

Choose a reason for hiding this comment

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

@hpb-htw Thanks for the changes. I asked for a few changes, and will review again after those are made.

For the changes to documentation, let's create a new set of changes for those. There will be a lot of changes, so let's do those togther as one big set of documentation changes.

@@ -7,7 +7,9 @@ import * as path2 from '../geometries/path2/index.js'
import { isGT, isGTE, isNumberArray } from './commonChecks.js'

/**
*
Copy link
Member

Choose a reason for hiding this comment

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

All the DOC changes are good but probably better in a separate set of changes, and pull request. I'll chat about the doc changes in the discussion.

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, let chat about it!

@@ -0,0 +1 @@
../../modeling/dist/jscad-modeling.es.js
Copy link
Member

Choose a reason for hiding this comment

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

Adding a link doesn't work in Windows. It's better to add a comment to README, and have the user copy jscad-modeling.es.js

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, TBD

// HACK... export the results of the design to global space
window.shapes = main()
</script>
<script type="module" id="MODELING" src="model.js"></script>
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer NOT to mix Common JS (require) and ES (import) in the same example. Let's keep these separated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Code in the file model.js does not belong to package, it shows, that one can construct a model with the same code in both context ES6 or CommonJS. Otherwise I cannot understand why this is written in the commit before my commit in the file demo.html:

<script language="javascript" src="./dist/jscad-regl-renderer.min.js" id="RENDERING"></script>

  <div id="jscad"></div>

  <script type="module" id="MODELING">
// ********************
// The design to render.
// ********************
import { booleans, colors, primitives } from "./jscad-modeling.es.js"
....

in the origin, which is dedicated for CommonJS.

<head>
<title>Demo Application</title>
<title>Demo Application Global</title>
Copy link
Member

Choose a reason for hiding this comment

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

Maybe 'Demo Application CommonJS'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, TBD

@@ -12,56 +12,13 @@
</style>
</head>
<body>
<script language="javascript" src="./dist/jscad-regl-renderer.min.js" id="RENDERING"></script>

<span>How to use regl-renderer as ES5 global variable <code>jscadReglRenderer</code></span>
Copy link
Member

Choose a reason for hiding this comment

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

...as 'CommonJS module'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, TBD

@hpb-htw
Copy link
Contributor Author

hpb-htw commented Mar 4, 2025

@z3dev Since I have'n never do a Merge Request with Code Review in Github before, can you explain me what I have to do now? Do the single changes as suggest in my branch and make a new request or just wait for you?

@z3dev
Copy link
Member

z3dev commented Mar 4, 2025

@z3dev Since I have'n never do a Merge Request with Code Review in Github before, can you explain me what I have to do now? Do the single changes as suggest in my branch and make a new request or just wait for you?

You can make changes to YOUR branch. Just make the change, commit, and push back to your branch. Any new changes will also show up here.

Don't worry too much. You can always start again. You will understand quickly.

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.

2 participants