Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

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/[email protected][email protected]/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].use[1]!/Users/alr/git/TBD54566975/developer.tbd.website/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/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/[email protected][email protected]/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].use[1]!../node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[6].use[2]!./src/css/docs.css","message":"Module Warning (from ../node_modules/.pnpm/[email protected][email protected][email protected][email protected]/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/[email protected][email protected]/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].use[1]!/Users/alr/git/TBD54566975/developer.tbd.website/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/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/[email protected][email protected]/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].use[1]!../node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[6].use[2]!./src/css/docs.css","message":"Module Warning (from ../node_modules/.pnpm/[email protected][email protected][email protected][email protected]/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/[email protected]/node_modules/sodium-javascript/randombytes.js","moduleName":"../node_modules/.pnpm/[email protected]/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/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@docusaurus/core/lib/webpack/utils.js:180:24
    at /Users/alr/git/TBD54566975/developer.tbd.website/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/MultiCompiler.js:554:14
    at processQueueWorker (/Users/alr/git/TBD54566975/developer.tbd.website/node_modules/.pnpm/[email protected]/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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants