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

New platform initial setup #11468

Merged
merged 8 commits into from
Jun 20, 2017
Merged

Conversation

kimjoar
Copy link
Contributor

@kimjoar kimjoar commented Apr 27, 2017

Initial architecture for #9675, including quite a bit of example code.

(The actual code diff is +3k~ lines, but tests and snapshots adds quite a few lines)

For explanation on setup see platform/README.md in the PR.

How files are required (can be a help when understanding the general flow):

deps

Todos

(these are NOT the todos for this PR, but things I've thought about while building this)

  • Http requests and the Elasticsearch.js client: Elasticsearch.js client in the new platform #12442
  • Types cleanup
    • (aka do NOT allow plugins to require into core, even for types)
    • Move types out of "local files" to prepare for external types. This is already done for a couple things, but not at a proper scale.
  • Elasticsearch.js typings
    • They are quite bad and needs tons of improvement
    • Make headers allowed
    • client.close doesn't exist in the typings
    • I think we should fork the existing one into ./packages and let it evolve with the rest of the code base.
  • Http server: [server] Expose HTTP service to plugins #12464
  • Better Typescript dev+build setup, included in Webpack et al
    • How should we start the server? Right now I "hacked" a scripts/platform.js in there, just to have something.
    • There are still a couple requires in the codebase we need to remove. Some of them seem to be related to default export stuff.
    • Use import() instead of require for plugins? (It makes starting plugins async, which doesn't fit nicely with starting the http server now, so we might need to await or something like that)
  • Logging: [Meta] Logging in the new platform #12469
  • eslint/tslint: TSLint/ESLint in the new platform #12470
  • Directory structure: Directory structure with the new platform #12466
  • Collect coverage from platform/plugins
  • Improve error handling
    • REST endpoints incl validation
    • Config errors at startup
    • Failure in long-running observables
  • Maybe explore having "local readmes" that explain the different parts of the system? E.g. in ./logger we have a readme that explains how the logger works. There is an example for the [plugin system][./server/plugins/README.md].

@kimjoar kimjoar self-assigned this Apr 27, 2017
@kimjoar kimjoar force-pushed the platform-setup-ts branch 3 times, most recently from cf6e3f2 to c87cb70 Compare April 27, 2017 13:06
@kimjoar kimjoar added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Apr 27, 2017
@kimjoar
Copy link
Contributor Author

kimjoar commented Apr 27, 2017

The build setup is bad right now, and this needs a lint setup, better TS setup, etc.

@kimjoar kimjoar force-pushed the platform-setup-ts branch 4 times, most recently from 28a1683 to 482d281 Compare May 8, 2017 11:37
@epixa
Copy link
Contributor

epixa commented May 17, 2017

I get an npm error when I try to build this with a fresh npm install:

courtmbp:kibana Court$ npm run ts:build

> kibana@6.0.0-alpha1 ts:build /p/kibana
> tsc

platform/server/elasticsearch/Cluster.ts(24,17): error TS2339: Property 'close' does not exist on type 'Client'.
platform/server/elasticsearch/Cluster.ts(25,23): error TS2339: Property 'close' does not exist on type 'Client'.
platform/server/http/SslConfig.ts(36,26): error TS2339: Property 'constants' does not exist on type 'typeof "crypto"'.

@kimjoar kimjoar force-pushed the platform-setup-ts branch 3 times, most recently from e66673a to f5c4fce Compare May 23, 2017 10:02
@kimjoar kimjoar force-pushed the platform-setup-ts branch 2 times, most recently from 14d44cc to be87628 Compare May 27, 2017 11:58
@kimjoar kimjoar force-pushed the platform-setup-ts branch 3 times, most recently from 983a7b9 to bde2d48 Compare June 19, 2017 18:23
@kimjoar kimjoar changed the base branch from master to new-platform June 20, 2017 21:24
@kimjoar kimjoar changed the title [WIP] Platform initial setup New platform initial setup Jun 20, 2017
@kimjoar kimjoar merged commit 1cb9397 into elastic:new-platform Jun 20, 2017
@kimjoar
Copy link
Contributor Author

kimjoar commented Jun 20, 2017

This was merged into the new-platform feature branch, where we'll be working more on this before preparing a proper PR to master.

@kimjoar kimjoar mentioned this pull request Jun 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants