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

build: extracted UI components to ui-kit in plugin-base-frontend #3470

Merged
merged 11 commits into from
Jul 25, 2024

Conversation

berezinant
Copy link
Contributor

@berezinant berezinant commented Jan 24, 2024

Fixes:
#3460
#3461
#3462

The UI component is just a couple of js and css files which are conntected to the markup by bem, if possible
The assets (ts and scss) are compiled by webpack, the results are stored in plugin-base as plain files js and css (both minified and non-minified for the sake of possible customization by users) files and committed to the repo.

@berezinant berezinant added format: html An issue/PR related to Dokka's default HTML output format infrastructure Everything related to builds tools, CI configurations and project tooling html: frontend An issue/PR that only or primarily requires frontend work (html/css) labels Jan 24, 2024
@berezinant berezinant added this to the Dokka 2.0.0 milestone Jan 24, 2024
@IgnatBeresnev IgnatBeresnev removed this from the Dokka 2.0.0 milestone Apr 25, 2024
@berezinant berezinant force-pushed the refactor-3460-styles-processing branch 3 times, most recently from 8b40b31 to 2cea11c Compare May 16, 2024 12:33
@berezinant berezinant changed the title build: added style files concatenation and minification to plugin base build: extracted UI components to ui-kit in plugin-base-frontend May 16, 2024
@berezinant berezinant force-pushed the refactor-3460-styles-processing branch from 2cea11c to f3358eb Compare May 16, 2024 12:35
@berezinant berezinant force-pushed the refactor-3460-styles-processing branch 3 times, most recently from e93a272 to 6f84eb3 Compare June 7, 2024 09:03
@berezinant berezinant force-pushed the refactor-3460-styles-processing branch from 31ae203 to 0d26102 Compare June 10, 2024 10:28
@berezinant berezinant marked this pull request as ready for review June 10, 2024 11:32
Copy link
Collaborator

@whyoleg whyoleg left a comment

Choose a reason for hiding this comment

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

LGTM

@berezinant berezinant force-pushed the refactor-3460-styles-processing branch 2 times, most recently from 09863bf to 303049d Compare June 14, 2024 17:09
Comment on lines +37 to +43
return records.map((record) => {
return {
...record,
template: <SearchResultRow searchResult={record} />,
} as Omit<OptionWithSearchResult, 'name'> & { name: unknown } as OptionWithHighlightComponent;
});
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

some typing fixes that aren't pretty but it's better then ignoring

Comment on lines -55 to -56
_showPopup(){
if(this.props.shouldShowPopup){
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this turns out to be unused

Comment on lines +17 to +25
const onChangeSelected = useCallback(
(selectItem: SelectItem<unknown> | null) => {
if (!selectItem) {
return;
}
const maybeOption: Option = selectItem as Option;
window.location.replace(`${(window as IWindow).pathToRoot}${maybeOption.location}?query=${maybeOption.name}`);
onSelected(maybeOption);
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

another hack just to proceed with legacy code

};
})();

export function initTabs() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is pretty much extracted from dokka-subprojects/plugin-base/src/main/resources/dokka/scripts/platform-content-handler.js

@berezinant berezinant force-pushed the refactor-3460-styles-processing branch 2 times, most recently from 4b131b1 to c884402 Compare June 21, 2024 06:56
@berezinant berezinant force-pushed the refactor-3460-styles-processing branch from c884402 to f4c8702 Compare July 1, 2024 06:41
@berezinant berezinant force-pushed the refactor-3460-styles-processing branch from f4c8702 to 16bd619 Compare July 24, 2024 13:25
@berezinant berezinant merged commit 2ff2b92 into master Jul 25, 2024
10 of 13 checks passed
@berezinant berezinant deleted the refactor-3460-styles-processing branch July 25, 2024 06:05
Comment on lines +42 to +43
**/node_modules
**/build
Copy link
Member

Choose a reason for hiding this comment

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

Belated nitpick: Are these excludes necessary?

build/ directories are already excluded on line 30, and node_modules/ is excluded specifically in dokka-subprojects/plugin-base-frontend/.gitignore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, it's really unnecessary, removed it in https://github.com/Kotlin/dokka/pull/3714/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format: html An issue/PR related to Dokka's default HTML output format html: frontend An issue/PR that only or primarily requires frontend work (html/css) infrastructure Everything related to builds tools, CI configurations and project tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants