Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit a191d40

Browse files
authored
Merge branch 'main' into update_x_chain_adapter
2 parents 2c9339e + a84691d commit a191d40

File tree

23 files changed

+1536
-721
lines changed

23 files changed

+1536
-721
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import dynamic from "next/dynamic";
2+
3+
export const DynamicPreloadSearch = dynamic(() => import("./PreloadSearch"), {
4+
ssr: false,
5+
});
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
"use client";
2+
3+
import { useEffect } from "react";
4+
5+
export interface PreloadSearchProps {}
6+
7+
/**
8+
* Hack to Preloads Search by making a search request, then clearing it.
9+
*
10+
* NOTE: This must be client-side only as it includes a useEffect hook.
11+
*
12+
* @see https://github.com/shuding/nextra/blob/v3/packages/nextra-theme-docs/src/components/flexsearch.tsx
13+
* @see https://github.com/shuding/nextra/blob/v3/packages/nextra-theme-docs/src/components/search.tsx
14+
*/
15+
export function PreloadSearch(): JSX.Element | null {
16+
useEffect(() => {
17+
// Try desktop nav container first
18+
let container = document.querySelector(".nextra-nav-container");
19+
20+
// Fallback to mobile sidebar container
21+
if (!container) {
22+
container = document.querySelector(".nextra-sidebar-container");
23+
}
24+
25+
if (!container) return;
26+
27+
const input = container.querySelector(
28+
'input[type="search"]',
29+
) as HTMLInputElement;
30+
if (!input) return;
31+
32+
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(
33+
window.HTMLInputElement.prototype,
34+
"value",
35+
)?.set;
36+
37+
nativeInputValueSetter?.call(input, "warmup");
38+
input.dispatchEvent(new Event("input", { bubbles: true }));
39+
40+
setTimeout(() => {
41+
nativeInputValueSetter?.call(input, "");
42+
input.dispatchEvent(new Event("input", { bubbles: true }));
43+
}, 500);
44+
}, []);
45+
46+
return null;
47+
}
48+
49+
export default PreloadSearch;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from "./PreloadSearch";
2+
export * from "./DynamicPreloadSearch";

apps/nextra/pages/_app.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { GoogleAnalytics } from "@next/third-parties/google";
22
import { docsConfig } from "@docs-config";
33
import "../styles.css";
4+
import { DynamicPreloadSearch } from "@components/preload-search";
45

56
export const config = {
67
runtime: "experimental-edge",
@@ -15,6 +16,7 @@ export default function App({ Component, pageProps }) {
1516
return (
1617
<>
1718
<GoogleAnalytics gaId={docsConfig.googleAnalyticsId} />
19+
<DynamicPreloadSearch />
1820
<Component {...pageProps} />
1921
</>
2022
);

apps/nextra/pages/_document.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ class MyDocument extends Document {
2121
`,
2222
}}
2323
/>
24+
<link
25+
rel="preload"
26+
href="/_next/static/chunks/nextra-data-en.json"
27+
as="fetch"
28+
type="application/json"
29+
crossOrigin="anonymous"
30+
/>
2431
</Head>
2532
<body>
2633
<SkipNavLink styled />

apps/nextra/pages/en/build/indexer/nft-aggregator/marketplaces.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ For each marketplace, we provide detailed event type mappings, example transacti
1313
</Callout>
1414

1515
<Cards>
16-
<Card href="./marketplaces/tradeport.mdx">
16+
<Card href="./marketplaces/tradeport">
1717
<Card.Title>Tradeport</Card.Title>
1818
<Card.Description>View supported events and example transactions for Tradeport</Card.Description>
1919
</Card>
2020

21-
<Card href="./marketplaces/bluemove.mdx">
21+
<Card href="./marketplaces/bluemove">
2222
<Card.Title>Bluemove</Card.Title>
2323
<Card.Description>View supported events and example transactions for Bluemove</Card.Description>
2424
</Card>
2525

26-
<Card href="./marketplaces/wapal.mdx">
26+
<Card href="./marketplaces/wapal">
2727
<Card.Title>Wapal</Card.Title>
2828
<Card.Description>View supported events and example transactions for Wapal</Card.Description>
2929
</Card>
3030

31-
<Card href="./marketplaces/rarible.mdx">
31+
<Card href="./marketplaces/rarible">
3232
<Card.Title>Rarible</Card.Title>
3333
<Card.Description>View supported events and example transactions for Rarible</Card.Description>
3434
</Card>
@@ -39,7 +39,7 @@ For each marketplace, we provide detailed event type mappings, example transacti
3939
These marketplaces are no longer operational, but their historical data remains available through our API.
4040

4141
<Cards>
42-
<Card href="./marketplaces/topaz.mdx">
42+
<Card href="./marketplaces/topaz">
4343
<Card.Title>Topaz (Deprecated)</Card.Title>
4444
<Card.Description>Historical data available for reference</Card.Description>
4545
</Card>

apps/nextra/pages/en/build/sdks/ts-sdk/building-transactions/script-composer.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
---
22
title: "Invoke chains of Move calls with Dynamic Script Composer"
33
---
4+
import { Callout } from 'nextra/components'
45

56
# Invoke chains of Move calls with Dynamic Script Composer
67

8+
<Callout type="warning" emoji="ℹ️">
9+
Due to the current large bundle size of the ts-sdk, we are temporarily removing the Script Composer feature from the ts-sdk.
10+
11+
In the future, we will provide this feature as a separate extension package.
12+
13+
If you wish to continue using Script Composer, please install version 1.39.0:
14+
[https://www.npmjs.com/package/@aptos-labs/ts-sdk/v/1.39.0](https://www.npmjs.com/package/@aptos-labs/ts-sdk/v/1.39.0)
15+
16+
</Callout>
17+
718
In the naive api, you only get to specify one entry function to invoke for one transaction. An advanced builder might want to be able to invoke multiple **public** Move functions inside one transaction. This is now enabled by the new `scriptComposer` api provided in the transaction builder.
819

920
Here's an example of how you can invoke the api:
Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
11
---
2-
title: "Move On Aptos Compiler (beta)"
2+
title: "Move On Aptos Compiler"
33
---
44

55
# Move On Aptos Compiler
66

7-
The Move on Aptos compiler (codename 'compiler v2') is a new tool which translates Move source code into Move bytecode. It unifies the architectures of the Move compiler and the Move Prover, enabling faster innovation in the Move language. It also offers new tools for defining code optimizations which can be leveraged to generate more gas efficient code for Move programs.
7+
The Move on Aptos compiler (codename 'compiler v2') translates Move source code into Move bytecode. It unifies the architectures of the Move compiler and the Move Prover, enabling faster innovation in the Move language. It also offers new tools for defining code optimizations which can be leveraged to generate more gas efficient code for Move programs.
88

9-
The new compiler supports Move 2, the latest revision of the Move language. Head over to the [release page in the book](book/move-2.mdx) to learn more about the new features in Move 2. Starting at Aptos CLI v6.0.0, this language version and the new compiler are the default.
9+
The Move on Aptos compiler supports Move 2, the latest revision of the Move language. Head over to the [release page in the book](book/move-2.mdx) to learn more about the new features in Move 2. Starting at Aptos CLI v6.0.0, this language version and the Move on Aptos compiler are the default. Note that Move 2 is generally backwards compatible with Move 1.
1010

11-
## Compiler v2 Release State
11+
## Move on Aptos Release State
1212

13-
Compiler v2 is now the default.
14-
15-
## Bug Bounty
16-
17-
We award a bounty for each unique semantic bug identified in the compiler. Bugs need to surface as a difference of execution outcome of the v1 and v2 compilers, as demonstrated by a Move unit test. Not all differences in the compiler behavior count for the program, [head over here](https://hackenproof.com/programs/move-on-aptos-compiler) for details of the bounty program. Even if a difference in behavior does not qualify for a bounty, we encourage you to open an issue using the link below.
13+
Move on Aptos is in production and is now the default compiler, with Move 2 being the default language version.
1814

1915
## Reporting an Issue
2016

2117
If you run into issues, please use [this link to create a github issue][bug]. If you are able to provide a small piece of Move code which reproduces the issue, debugging and fixing it will be easier for us.
2218

2319
[bug]: https://github.com/aptos-labs/aptos-core/issues/new?title=[compiler-v2]%20%3CPLEASE%20NAME%20IT%3E&body=%3CPLEASE%20DESCRIBE%20IT%3E&labels=compiler-v2&projects=aptos-labs/16
2420

25-
## Using Compiler v2
21+
## Using Move on Aptos Compiler
2622

2723
Ensure to have installed the latest version of the Aptos CLI:
2824

@@ -31,21 +27,10 @@ aptos update aptos # on supported OS
3127
brew upgrade aptos # on MacOS
3228
```
3329

34-
Compiler v2 and Move 2 are now the default, requiring no changes to your usage. Examples:
30+
Move on Aptos compiler and Move 2 are now the default, requiring no changes to your usage. Examples:
3531

3632
```bash filename="Terminal"
3733
aptos move compile
3834
aptos move test
3935
aptos move prove
4036
```
41-
42-
## Using Compiler v1
43-
44-
Compiler v1 (i.e., the old compiler) is expected to be sunset soon, as it does not support any of the Move 2 features, and is thus not recommended for use. However, if you still want to use compiler v1 before it is sunset, on your project that does not use any Move 2 features, you can do so with the `--move-1` flag (eg., `aptos move compile --move-1` or `aptos move test --move-1`). You may need to specify the `aptos-release-v1.25` version of the Aptos framework in the dependencies (this is the last version of the Aptos framework that does not use any Move 2 features), as shown below.
45-
46-
```toml filename="Move.toml"
47-
[dependencies.AptosFramework]
48-
git = "https://github.com/aptos-labs/aptos-framework.git"
49-
rev = "aptos-release-v1.25"
50-
subdir = "aptos-framework"
51-
```

apps/nextra/pages/en/build/smart-contracts/linter.mdx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ The "Aptos Move Lint" tool runs on a Move package to find and warn about common
88

99
You can run it with the aptos CLI command: `aptos move lint`.
1010

11-
This tool is currently in beta, so please try it out and submit [bugs and feedback](https://github.com/aptos-labs/aptos-core/issues/new?title=%5Blinter%5D%20%3CDescriptive%20Title%3E&body=%3CDetailed%20description%20of%20the%20issue%20or%20feature%20request%3E&labels=move-linter&projects=aptos-labs/16). Also, we are tracking ideas and prioritization requests for new lint rules [here](https://github.com/aptos-labs/aptos-core/issues/15221), we welcome your contributions.
11+
If you find any issues, please submit [bugs and feedback](https://github.com/aptos-labs/aptos-core/issues/new?title=%5Blinter%5D%20%3CDescriptive%20Title%3E&body=%3CDetailed%20description%20of%20the%20issue%20or%20feature%20request%3E&labels=move-linter&projects=aptos-labs/16). Also, we are tracking ideas and prioritization requests for new lint rules [here](https://github.com/aptos-labs/aptos-core/issues/15221), we welcome your contributions.
1212

1313

1414
## Lint Checks
15+
### `almost_swapped`
16+
Checks for expression patterns that look like a failed swap attempt and notifies the user. These patterns are likely erroneous code. This currently only detects simple access patterns such as assignments to a variable or a field of a struct. Examples include:
17+
- `a = b; b = a;` which can be correctly swapped with `(a, b) = (b, a);`
18+
- `a.x = b.x; b.x = a.x;` which can be correctly swapped with `(a.x, b.x) = (b.x, a.x);`
19+
1520
### `avoid_copy_on_identity_comparison`
1621

1722
Checks for identity comparisons (`==` or `!=`) between copied values of type `vector` or `struct` (i.e., types for which copy can be expensive). It instead suggests to use reference-based identity comparison instead (i.e., use `&x == &y` instead of `x == y`, when the above mentioned conditions meet).
@@ -89,6 +94,13 @@ Check for boolean expressions that can be simplified when a boolean literal (eit
8994
Does NOT consider side-effects/short-circuiting in the recommended simplifications. Example:
9095
- `1/0 || true` is logically equivalent to `true`, but applying this simplification affects program semantics.
9196

97+
### `self_assignment`
98+
99+
Checks for patterns where a variable or a field of a struct is assigned to itself and suggests removing the assignment. These assignments do not affect the state of the program. Examples include:
100+
- `let x = x;`
101+
- `x = x;`
102+
- `a.x = a.x;`
103+
92104
### `simpler_numeric_expression`
93105

94106
Checks for various patterns where a simpler numeric expression can be used instead. In all these cases, the code must already type check, and `x` can be any numeric expression.
Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
11
export default {
22
"fullnode-rest-api-reference": {
3-
title: "全节点 REST API 参考",
3+
title: "Fullnode REST API Reference",
44
theme: {
55
toc: false,
66
layout: "full",
77
sidebar: false,
88
},
9-
href: "/en/build/apis/fullnode-rest-api-reference",
109
},
11-
"fullnode-rest-api": "全节点 REST API 指南",
10+
"fullnode-rest-api": "Fullnode REST API Guide",
1211
"indexer-graphql-api": {
13-
title: "索引器 GraphQL API",
14-
href: "/zh/build/indexer",
15-
},
16-
"data-providers": {
17-
title: "数据提供商",
18-
href: "/en/build/apis/data-providers",
12+
title: "Indexer GraphQL API",
13+
href: "/en/build/indexer",
1914
},
15+
"data-providers": "Data Providers",
2016
"faucet-api": {
21-
title: "水龙头 API",
22-
href: "/en/build/apis/faucet-api",
23-
},
24-
"aptos-labs-developer-portal": {
25-
title: "API 网关",
26-
href: "/en/build/apis/aptos-labs-developer-portal",
17+
title: "Faucet API",
2718
},
19+
"aptos-labs-developer-portal": "API Gateway",
2820
};

0 commit comments

Comments
 (0)