feat: Cpanel::JSON::XS (JSON::PP shim) + strict FQ barewords#718
Merged
Conversation
54e0b47 to
7871373
Compare
…words - Add Cpanel::JSON::XS inheriting bundled JSON::PP with encode_json/decode_json wrappers (class-method invocant strip via Scalar::Util::blessed; allow_nonref; croak on type-aware extras). - Ship Cpanel::JSON::XS::Type (pure-Perl constants) and ::Boolean. - Interpreter + JVM: under strict subs, treat Package::Name::sub barewords as a runtime nullary sub lookup (QualifiedBarewordSubCall) so use_ok + use constant ordering matches CPAN-style smoke tests. - Document bundled module and xs-compatibility; changelog and feature matrix. Generated with [Cursor](https://cursor.com/) Co-Authored-By: Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Remove QualifiedBarewordSubCall and the bytecode/JVM paths that treated fully qualified barewords as late-bound nullary subs under strict subs. Stock Perl 5 rejects those at compile time. Bundled Cpanel::JSON::XS smoke resolves JSON_TYPE_INT via ->can after use_ok. Add dev/modules/cpanel_json_xs.md and index it from dev/modules/README.md. Generated with [Cursor](https://cursor.com/) Co-Authored-By: Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
…ch layout - Ship bundled CPAN distroprefs as YAML under PerlOnJava/CpanDistroprefs/ - Copy prefs/patches from jar via CPAN::Config bootstrap (remove inline heredocs) - Add Net-Server and CPAN-FindDependencies patch files; un-ignore CpanPatches/**/*.patch - Remove duplicate CPAN/Prefs/*.yml; add Prefs/README pointer - Add dev/design/patch-and-cpan-prefs-layout.md; cross-link guides and roadmap - Note import vs CPAN patch pipelines in sync.pl header Generated with [Cursor](https://cursor.com) Co-Authored-By: Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
- Add dev/tools/test-cpan-distroprefs.sh and Makefile target (shadowJar + jcpan -t) - Moose: PerlOnJava::Distroprefs::Moose::test_phase runs prove but reports OK to CPAN - OpenAI::API smoke: 3600s timeout (cold CPAN home pulls many deps) - Skip XML::LibXML by default (INCLUDE_XML_LIBXML_IN_DISTROPREF_SMOKE=1 to opt in) - Document XML opt-in and SKIP_* knobs in design doc Generated with [Cursor](https://cursor.com) Co-Authored-By: Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
7871373 to
cf091cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bundles Cpanel::JSON::XS (and ::Type / ::Boolean) for PerlOnJava by inheriting the same JSON::PP stack already used by bundled JSON, with small wrappers for CPAN-visible calling conventions.
Also fixes strict subs handling for fully qualified barewords such as
Cpanel::JSON::XS::Type::JSON_TYPE_INTwhen the sub is only installed at runtime (typicaluse_okthenuse constantordering in smoke tests). Stock Perl 5 still rejects those at compile time; PerlOnJava now resolves them at runtime viaQualifiedBarewordSubCall.Tests
make(unit tests + shadowJar): PASSJPERL_TEST_FILTER=Cpanel-JSON-XS ./gradlew testModule: PASSNotes
encode_jsonstrips a leading invocant only when it is a blessed instance ofCpanel::JSON::XS(Scalar::Util::blessed), so plain hash/array refs are never passed toisa.00_smoke.tuses 9 planned tests (threeuse_okplus six assertions).