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

Cleanup #804

Merged
merged 33 commits into from
Sep 10, 2020
Merged

Cleanup #804

merged 33 commits into from
Sep 10, 2020

Conversation

LoicPoullain
Copy link
Member

@LoicPoullain LoicPoullain commented Aug 28, 2020

Issue & steps

  • Remove the object ValidationError and the function validate which are unused and do not bring value to the framework.
  • Remove the deprecated function createHttpResponseFile and use Disk.createHttpResponseFile instead. Once done, remove the package mime from @foal/core dependencies.
  • Remove the package @foal/formidable and use the @ValidateMultipartFormDataBody hook instead.
  • Remove the deprecated legacy option of the functions hashPassword and verifyPassword. This option was used in very old versions of Foal when no one was using the framework.
  • Remove the deprecated package @foal/ejs and the possibility to create FoalTS template engines. Only Express templates engines will be allowed (Twig, EJS, pug, etc).
  • Drop the support of Node 8 and run tests on Node 12 and 14. Version 8 of Node is not maintained anymore. Uninstall pump in @foal/core, @foal/storage and @foal/aws-s3 and use the pipeline function from the standard library (added in Node 10).
  • Remove the unused command foal g sub-app.
  • Check if password hashing needs an update (OWASP).
  • Make createApp return a promise and remove createAndInitApp. The function createAndInitApp was introduced because we needed to return a promise.
    // Before
    const app = createApp();
    const app = await createAndInitApp();
    
    // After
    const app = await createApp();
  • Only allow one way to pass a custom express instance to createApp.
    // Before
    const expressInstance = express();
    const app = createApp(expressInstance);
    // OR
    const app = createApp({ expressInstance });
    
    // After
    const expressInstance = express();
    const app = createApp({ expressInstance });

This PR also resolves #710.

Breaking changes

  • TypeScript 4.0 or higher is required.
  • Package @foal/ejs removed. Install and use ejs directly in config: settings.templateEngine: ejs.
  • Package @foal/formidable and createHttpResponseFile. TODO: write a guide to explain how to use Disk instead.
  • createApp returns a promise and calls AppController.init.
  • Legacy option removed in hashPassword. If you use it (very unlikely), please open an issue.
  • createApp(expressInstance) -> createApp({ expressInstance }).
  • foal g sub-app removed.
  • validate function removed. ValidationError, isValidationError removed. Use AJV directly instead (or validation hooks).
  • createService and createService do not accept a serviceManager as second parameter.
  • Use Disk instead of AbstractDisk

Checklist

  • Add/update/check docs (code comments and docs/ folder).
  • Add/update/check tests.
  • Update/check the cli generators.

Dependencies

  • @foal/cli
    • commander@6.1
  • @foal/jwks-rsa
    • jwks-rsa@1.9
  • @foal/swagger
    • swagger-ui-dist@3.32
  • @foal/typestack
    • class-transformer@03

@LoicPoullain LoicPoullain added this to Work In Progress in Issue tracking via automation Aug 28, 2020
@LoicPoullain LoicPoullain merged commit 7bf4368 into v2-0-0 Sep 10, 2020
Issue tracking automation moved this from Work In Progress to Done / Closed This Release Sep 10, 2020
@LoicPoullain LoicPoullain deleted the cleanup-v2 branch September 10, 2020 16:24
@LoicPoullain LoicPoullain mentioned this pull request Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Issue tracking
  
Done / Closed This Release
Development

Successfully merging this pull request may close these issues.

None yet

1 participant