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

ALR Skunkworks testing: Java as a docs language #1267

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ALRubinger
Copy link
Contributor

@ALRubinger ALRubinger commented Feb 20, 2024

This is a test; as of now, it's not an incoming PR.

A little trial I'm vetting to see the lift involved in writing Java docs examples calling upon the JVM bytecode available to it from tbdex-kt and web5-kt.

  • Configure Kotlin and Java sources to coexist in the testsuite
  • Make a real Java port of an existing Kotlin test
  • Hook Java snippets into docs
  • Add Java support to Shnippet
  • Configure Docusaurus CodeBlock component for Java syntax highlighting
  • Add Java support to CodeSnippet component

Looks like:
Screenshot at 2024-02-20 04-22-26

TODO:

  • Refactor testsuite-kotlin to testsuite-jvm or even better, just jvm alongside the other suite becoming js instead of testsuite-js
  • Get import statements in the trial Java test to come from real code, and surface in docs
  • Why is Netlify failing? Sync w/ the King of This Stuff, @dayhaysoos, for assistance. Error message provided is trash and he's good at just, like, knowing what it's complaining about.
  • If we do this, shall we add JavaDoc API References to the Kotlin SDK? Looks possible.
  • Even though these tests work, validate with upstream Kotlin team that my test is using the preferred Java call paths ported from Kotlin:
// Creates a DID using the did:jwk method
final DidJwk didJwk = DidJwk.Companion.create(new InMemoryKeyManager(), null);

// DID and its associated data which can be exported and used in different contexts/apps
final DidResolutionResult portableDid = didJwk.resolve();

// DID String
final String did = didJwk.getUri();

// DID Document
final DIDDocument didDocument = portableDid.getDidDocument();

Copy link

netlify bot commented Feb 20, 2024

Deploy Preview for tbd-website-developer ready!

Name Link
🔨 Latest commit cac3666
🔍 Latest deploy log https://app.netlify.com/sites/tbd-website-developer/deploys/65dad64bc0351b00081870ba
😎 Deploy Preview https://deploy-preview-1267--tbd-website-developer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ALRubinger ALRubinger self-assigned this Feb 20, 2024
@ALRubinger
Copy link
Contributor Author

@dayhaysoos This works in pnpm start OK, but build is failing as we see here. Any ideas?

Non-blocking, non-critical. This whole thing is my side project ATM.

Copy link
Member

Choose a reason for hiding this comment

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

Please make a clone of this doc and experiment with that one. I'm trying to get everyone to stop experimenting in our most widely used guide, as we've had to urgently do a fast-follow twice before (late at night) when changes have been merged and this top priority doc has been broken

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pay no attention to that man behind the curtain. 🤣

Looks like I picked a hot article to port over as my end-to-end test. Not to worry - this PR isn't destined for any merge to main until we have cross-team coordination. It introduces an experimental feature I'm vetting. You won't be needing any late night fixes from this, my Island of Misfit Toys.

@ALRubinger
Copy link
Contributor Author

@dayhaysoos This works in pnpm start OK, but build is failing as we see here. Any ideas?

Non-blocking, non-critical. This whole thing is my side project ATM.

These are the errors on pnpm build:

[WARNING] {"moduleIdentifier":"/Users/alr/git/TBD54566975/developer.tbd.website/node_modules/.pnpm/css-loader@6.9.0_webpack@5.89.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].use[1]!/Users/alr/git/TBD54566975/developer.tbd.website/node_modules/.pnpm/postcss-loader@7.3.4_postcss@8.4.31_typescript@5.3.3_webpack@5.89.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[6].use[2]!/Users/alr/git/TBD54566975/developer.tbd.website/site/src/css/docs.css","moduleName":"../node_modules/.pnpm/css-loader@6.9.0_webpack@5.89.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].use[1]!../node_modules/.pnpm/postcss-loader@7.3.4_postcss@8.4.31_typescript@5.3.3_webpack@5.89.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[6].use[2]!./src/css/docs.css","message":"Module Warning (from ../node_modules/.pnpm/postcss-loader@7.3.4_postcss@8.4.31_typescript@5.3.3_webpack@5.89.0/node_modules/postcss-loader/dist/cjs.js):\n(219:3) from \"autoprefixer\" plugin: start value has mixed support, consider using flex-start instead\n\nCode:\n  justify-content: start\n","compilerPath":"client"}
[WARNING] {"moduleIdentifier":"/Users/alr/git/TBD54566975/developer.tbd.website/node_modules/.pnpm/css-loader@6.9.0_webpack@5.89.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].use[1]!/Users/alr/git/TBD54566975/developer.tbd.website/node_modules/.pnpm/postcss-loader@7.3.4_postcss@8.4.31_typescript@5.3.3_webpack@5.89.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[6].use[2]!/Users/alr/git/TBD54566975/developer.tbd.website/site/src/css/docs.css","moduleName":"../node_modules/.pnpm/css-loader@6.9.0_webpack@5.89.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].use[1]!../node_modules/.pnpm/postcss-loader@7.3.4_postcss@8.4.31_typescript@5.3.3_webpack@5.89.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[6].use[2]!./src/css/docs.css","message":"Module Warning (from ../node_modules/.pnpm/postcss-loader@7.3.4_postcss@8.4.31_typescript@5.3.3_webpack@5.89.0/node_modules/postcss-loader/dist/cjs.js):\n(219:3) from \"autoprefixer\" plugin: start value has mixed support, consider using flex-start instead\n\nCode:\n  justify-content: start\n","compilerPath":"client"}
[WARNING] {"moduleIdentifier":"/Users/alr/git/TBD54566975/developer.tbd.website/node_modules/.pnpm/sodium-javascript@0.8.0/node_modules/sodium-javascript/randombytes.js","moduleName":"../node_modules/.pnpm/sodium-javascript@0.8.0/node_modules/sodium-javascript/randombytes.js","loc":"23:6-13","message":"Critical dependency: require function is used in a way in which dependencies cannot be statically extracted","compilerPath":"client"}
[ERROR] Unable to build website for locale en.
[ERROR] Error: Failed to compile with errors.
    at /Users/alr/git/TBD54566975/developer.tbd.website/node_modules/.pnpm/@docusaurus+core@2.4.1_@docusaurus+types@2.4.1_react-dom@17.0.2_react@17.0.2_typescript@5.3.3/node_modules/@docusaurus/core/lib/webpack/utils.js:180:24
    at /Users/alr/git/TBD54566975/developer.tbd.website/node_modules/.pnpm/webpack@5.89.0/node_modules/webpack/lib/MultiCompiler.js:554:14
    at processQueueWorker (/Users/alr/git/TBD54566975/developer.tbd.website/node_modules/.pnpm/webpack@5.89.0/node_modules/webpack/lib/MultiCompiler.js:491:6)
    at processTicksAndRejections (node:internal/process/task_queues:78:11)

@ALRubinger ALRubinger force-pushed the alr-skunkworks branch 2 times, most recently from 04d236e to 470edaa Compare February 25, 2024 05:42
* Configure Kotlin and Java sources to coexist in the testsuite
* Make a real Java port of an existing Kotlin test
* Hook Java snippets into docs
* Add Java support to Shnippet
* Configure Docusaurus CodeBlock component for Java syntax highlighting
* Add Java support to CodeSnippet component
* Work around a ReDoc bug (java language support needs scala too)
@ALRubinger
Copy link
Contributor Author

Rebased on main, all issues fixed up.

@angiejones angiejones closed this Jul 11, 2024
@angiejones angiejones deleted the alr-skunkworks branch July 11, 2024 04:12
@ALRubinger ALRubinger restored the alr-skunkworks branch July 12, 2024 14:08
@ALRubinger
Copy link
Contributor Author

Will reopen as draft and restoring branch; don't want to lose this work. If we need to move off somewhere for clarity, let's. But we shouldn't delete it entirely, may have value looking forward if we enable Java as a docs language.

@ALRubinger ALRubinger reopened this Jul 12, 2024
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