Skip to content

refactor: delete shallow and unused generator modules - #1959

Merged
ChiragAgg5k merged 1 commit into
mainfrom
refactor/remove-shallow-generator-modules
Oct 3, 2026
Merged

ChiragAgg5k merged 1 commit into
mainfrom
refactor/remove-shallow-generator-modules

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

Summary

Implement the five deletion-test candidates in one change (net removal: 733 lines):

  • Remove the unused getParamDefault() language interface, all 13 implementations, its Twig filter, and the now-unused schema-default helper.
  • Remove obsolete Bower and social-sharing configuration and their documentation.
  • Remove unused caseArray, emptyResponse, securityNames, and paramsQuery Twig filters. Keep caseSlash, which is used in Kotlin/Android destination paths.
  • Remove Web's generated Service module and its file registration. Location methods reuse Client.flatten(); Push owns its client directly. React Native retains its separate base module and upload behaviour.
  • Remove SDK::methodName() and call the language interface directly.
  • Add a declarative generation regression check for Web/Node base-module absence, React Native retention, flattening references, and Push declarations.

Compatibility

This deliberately removes public generator methods (getParamDefault(), setBowerPackage(), and the four setShare*() methods), protected helpers, and unused Twig filters. No repository callers remain, but external generator consumers/custom templates using them will need updating. Web no longer emits src/service.ts; deep imports of that internal file or reliance on Push's former inheritance also need updating. React Native is unchanged.

Verification

Passed:

  • php -d memory_limit=512M example.php: regenerated all supported example targets. The default 128 MB limit was insufficient for the combined generation, so the complete run used 512 MB.
  • Clean regeneration: php example.php web client, php example.php node server, php example.php react-native client; inspected generated ownership/flattening and base-module output.
  • vendor/bin/phpunit --testsuite Generation: 92 tests, 1,195 assertions, 4 skips.
  • composer lint, composer refactor:check, composer lint-twig (636 templates, zero errors).
  • Web: npm ci, npm run format:check, npm run lint, npm run analyse, npm run build.
  • Node: npm ci, formatting/lint/type checks, npm run build, npm run test -- --runInBand: 36 suites, 897 tests passed. Tests require building the distribution first.
  • React Native: npm ci --omit=peer, formatting/lint/type checks.
  • CLI: go mod tidy to install generated dependencies, then go build ./..., go vet ./..., go test ./....
  • Go/CLI: test -z "$(gofmt -l examples/go examples/cli)".
  • Built Web runtime smoke with Node assertions: Push retains the supplied client, Client.flatten() preserves array query encoding, and Avatars.getInitials() generates the expected name/width/project query parameters.
  • git diff --check.

Blocked:

  • vendor/bin/phpunit tests/e2e/WebNodeTest.php: mock-server startup failed because the local Docker daemon is not running. Docker-backed HTTP/browser/MQTT e2e verification has not passed.

These are generator/SDK checks without meaningful application UI evidence; no screenshots are applicable. Generated output is gitignored and is not committed.

@ghost

ghost commented Oct 3, 2026

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

No concrete defects found after checking remaining references, inherited language registrations, flattening equivalence, and existing behavior-test coverage.

Removes unused generator default-value APIs, Twig filters, and Bower/social-sharing configuration, along with their documentation. Web generation no longer emits a Service base module: location methods use Client.flatten() and Push stores its client directly, while React Native retains its separate implementation. Adds generation checks for the resulting JavaScript SDK structure.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 9
File Change
CONTRIBUTING.md Removes documentation for deleted default-value and social-sharing APIs.
src/SDK/Language.php Removes the default-value interface and schema-default helper.
src/SDK/Language/{Dart,DotNet,Go,GraphQL,JS,Kotlin,PHP,Python,REST,Ruby,Rust,Skills,Swift}.php Deletes unused default-value implementations; JS also drops Bower configuration.
src/SDK/Language/Web.php Stops registering the generated Service module.
src/SDK/SDK.php Removes unused filters and social-sharing setters; calls language method naming directly.
templates/web/src/service.ts.twig Deletes the obsolete Web Service template.
templates/web/src/services/push.ts.twig Stores the supplied client without inheriting Service.
templates/web/src/services/template.ts.twig Uses Client.flatten() and removes Service imports.
tests/generation/GenerationTest.php Checks base-module presence, flattening references, and Push declarations across JavaScript targets.

Reviewed 0d9257a · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Tier S · Looks good to merge. Summary

@ChiragAgg5k
ChiragAgg5k merged commit 14d6173 into main Oct 3, 2026
61 checks passed
huangyingting pushed a commit to repomesh/appwrite that referenced this pull request Oct 3, 2026
sdk-generator 5.3.4 (appwrite/sdk-generator#1959) deleted the share and Bower settings: no template read them. The SDKs task still set them, so generation fails with 'Call to undefined method' on 5.3.4. Removing the calls works on every 5.x generator.
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.

1 participant