gravity-ui / rfc

Gravity RFC is a process for proposing and implementing changes in our ecosystem
MIT License
4 stars 0 forks source link

Modular assembly of the @gravity-ui/websql-autocomplete package #14

Closed itwillwork closed 1 month ago

itwillwork commented 3 months ago

Objective

The dist/index.js file from @gravity-ui/websql-autocomplete is almost 5.2MB

telegram-cloud-photo-size-2-5429371350214107918-y

Solution Proposal

Assemble the build separately by language (clickhouse, postgresql, mysql и yql).

Definition of done

The required language can be imported modularly from the @gravity-ui/websql-autocomplete package

Ex.

import {parseYqlQuery, YQLLexer, YQLParser} from '@gravity-ui/websql-autocomplete/yql';
SeqviriouM commented 3 months ago

@roberthovsepyan @Raubzeug what do you think?

Raubzeug commented 3 months ago

As for me, separate build should be done 100%. But I'm not sure we should expose Parser and Lexer directly - it may spawn duplicate logic inside applications. As for me, common goals (autocomplete, syntax colorize) should be achieved inside library, and relevant api should be exposed. Parser and Lexer are low-level entities, they may change dramatically, and I think that user should not be aware of it. @NikitaShkaruba @roberthovsepyan

SeqviriouM commented 3 months ago

@NikitaShkaruba @roberthovsepyan what do you think?

roberthovsepyan commented 3 months ago

I agree with @Raubzeug. I don't see why we now need the extra exports of parser, lexer. The rest is great

SeqviriouM commented 1 month ago

@NikitaShkaruba @roberthovsepyan @Raubzeug what are our next steps? Will you be able to do this task, or will we look for a volunteer?

roberthovsepyan commented 1 month ago

@SeqviriouM we already implemented this Closing the issue now

roberthovsepyan commented 1 month ago

Implemented in https://github.com/gravity-ui/websql-autocomplete/pull/196