-
Notifications
You must be signed in to change notification settings - Fork 122
refactor: align Lynx terminology with official specification #2276
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
base: main
Are you sure you want to change the base?
Changes from all commits
a4724f2
01aac26
6f0b0a2
be16fc5
eb726a5
2f7528a
ccef93e
97e5db3
21774ee
b0fb9ac
a38e2d7
685a09b
a1c206b
21e972f
9e46237
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| "@lynx-js/web-constants": patch | ||
| "@lynx-js/web-core": patch | ||
| "@lynx-js/react-webpack-plugin": patch | ||
| "@lynx-js/template-webpack-plugin": patch | ||
| "@lynx-js/react-rsbuild-plugin": patch | ||
| --- | ||
|
|
||
| Align codebase terminology with the official Lynx specification. Add new preferred type aliases (`LynxBundle`, `BundleLoader`, `DecodedBundle`, `BundleSectionLabel`, `BundleHooks`, `LynxBundlePlugin`, `LynxBundlePluginOptions`) and deprecate legacy names. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,9 +113,9 @@ export function pluginLynxConfig( | |
|
|
||
| api.modifyBundlerChain(chain => { | ||
| const exposed = api.useExposed< | ||
| { LynxTemplatePlugin: typeof LynxTemplatePlugin } | ||
| { LynxBundlePlugin: typeof LynxTemplatePlugin } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to migrate |
||
| >( | ||
| Symbol.for('LynxTemplatePlugin'), | ||
| Symbol.for('LynxBundlePlugin'), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There should also be a changeset for |
||
| ) | ||
|
Comment on lines
+116
to
119
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should be compatible with the legacy const exposed = api.useExposed<
{ LynxBundlePlugin: typeof LynxTemplatePlugin }
>(
Symbol.for('LynxBundlePlugin'),
) ?? api.useExposed<
{ LynxTemplatePlugin: typeof LynxTemplatePlugin }
>(
Symbol.for('LynxTemplatePlugin'),
) |
||
|
|
||
| if (!exposed) { | ||
|
|
@@ -131,7 +131,7 @@ export function pluginLynxConfig( | |
|
|
||
| throw new Error( | ||
| `\ | ||
| [pluginLynxConfig] No \`LynxTemplatePlugin\` exposed to ${ | ||
| [pluginLynxConfig] No \`LynxBundlePlugin\` exposed to ${ | ||
| link( | ||
| 'the plugin API', | ||
| 'https://rsbuild.rs/plugins/dev/core#apiexpose', | ||
|
|
@@ -150,7 +150,7 @@ See ${ | |
| ) | ||
| } | ||
|
|
||
| const { LynxTemplatePlugin: LynxTemplatePluginClass } = exposed | ||
| const { LynxBundlePlugin: LynxTemplatePluginClass } = exposed | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto here |
||
|
|
||
| chain.plugin('lynx:config').use(LynxConfigWebpackPlugin<Config>, [ | ||
| { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,11 @@ | ||
| import type { LynxTemplate } from './LynxModule.js'; | ||
| import type { LynxBundle } from './LynxModule.js'; | ||
|
|
||
| export type TemplateLoader = (url: string) => Promise<LynxTemplate>; | ||
| /** | ||
| * Loads a Lynx Bundle from the given URL. | ||
| */ | ||
| export type BundleLoader = (url: string) => Promise<LynxBundle>; | ||
|
|
||
| /** | ||
| * @deprecated Use {@link BundleLoader} instead. | ||
| */ | ||
| export type TemplateLoader = BundleLoader; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we also rename
@lynx-js/template-webpack-pluginto@lynx-js/bundle-webpack-plugin? (Might be a breaking change)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1.
@lynx-js/template-webpack-pluginshould only be used by us.