Skip to content

Commit

Permalink
Rename `set_inner_text to set_text
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislearn committed Nov 10, 2023
1 parent 2f47937 commit 674328a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions crates/cli/src/service/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ impl ServerProcess {
// windows doesn't like to overwrite a running binary, so we copy it to a new name
let bin_path = if cfg!(target_os = "windows") {
// solution to allow cargo to overwrite a running binary on some platforms:
// copy cargo's output bin to [filename]_glory and then run it
let new_bin_path = append_str_to_filename(bin, "_glory")?;
// copy cargo's output bin to [filename].serving and then run it
let new_bin_path = append_str_to_filename(bin, ".serving")?;
log::debug!(
"Copying server binary {} to {}",
GRAY.paint(bin.as_str()),
Expand All @@ -91,7 +91,7 @@ impl ServerProcess {
fs::copy(bin, &new_bin_path).await?;
// also copy the .pdb file if it exists to allow debugging to attach
if let Some(pdb) = determine_pdb_filename(bin) {
let new_pdb_path = append_str_to_filename(&pdb, "_glory")?;
let new_pdb_path = append_str_to_filename(&pdb, ".serving")?;
log::debug!(
"Copying server binary debug info {} to {}",
GRAY.paint(pdb.as_str()),
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/web/holders/browser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl Holder for BrowerHolder {
if let Ok(list) = crate::web::document().query_selector_all("[gly-id]") {
for i in 0..list.length() {
let ele = list.item(i).unwrap().unchecked_into::<web_sys::HtmlElement>();
ele.set_attribute("gly-hydrating", "true").unwrap_throw();
ele.set_attribute("gly-hydrating", "1").unwrap_throw();
}
}
let view_id = ViewId::new(self.next_root_view_id.fetch_add(1, Ordering::Relaxed).to_string());
Expand Down
6 changes: 3 additions & 3 deletions crates/core/src/web/widgets/csr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ where
/// Be very careful when using this method. Always remember to
/// sanitize the input to avoid a cross-site scripting (XSS)
/// vulnerability.
pub fn set_inner_text<V>(&mut self, text: V)
pub fn set_text<V>(&mut self, text: V)
where
V: AttrValue + 'static,
{
Expand All @@ -340,11 +340,11 @@ where
/// Be very careful when using this method. Always remember to
/// sanitize the input to avoid a cross-site scripting (XSS)
/// vulnerability.
pub fn inner_text<V>(mut self, text: V) -> Self
pub fn text<V>(mut self, text: V) -> Self
where
V: AttrValue + 'static,
{
self.set_inner_text(text);
self.set_text(text);
self
}

Expand Down
12 changes: 6 additions & 6 deletions crates/core/src/web/widgets/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ macro_rules! generate_tags {
self.0.add_event_listener(event, event_handler);
self
}
pub fn inner_text<V>(mut self, text: V) -> Self
pub fn text<V>(mut self, text: V) -> Self
where
V: AttrValue + 'static,
{
self.0.set_inner_text(text);
self.0.set_text(text);
self
}
/// Sets the inner HTML of this element from the provided
Expand Down Expand Up @@ -292,7 +292,7 @@ generate_tags![
style Style HtmlStyleElement [media, disabled],

/// The `<title>` HTML element defines the document's title that is shown in a Browser's title bar or a page's tab. It only contains text; tags within the element are ignored.
title Title HtmlTitleElement [text],
title Title HtmlTitleElement [],

// ==========================
// Sectioning Root
Expand Down Expand Up @@ -394,7 +394,7 @@ generate_tags![
// Inline Text Semantics
// ==========================
/// The `<a>` HTML element (or anchor element), with its href attribute, creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address.
a A HtmlAnchorElement [access_key "accessKey", download, hash, host, host_name "hostname", href, href_lang "hreflang", password, path_name "pathname", port, protocol, referrer_policy "referrerPolicy", rel, search, tab_index "tabIndex", target, text, type_ "type", user_name "username"],
a A HtmlAnchorElement [access_key "accessKey", download, hash, host, host_name "hostname", href, href_lang "hreflang", password, path_name "pathname", port, protocol, referrer_policy "referrerPolicy", rel, search, tab_index "tabIndex", target, type_ "type", user_name "username"],

/// The `<abbr>` HTML element represents an abbreviation or acronym; the optional title attribute can provide an expansion or description for the abbreviation. If present, title must contain this full description and nothing else.
abbr Abbr HtmlElement [],
Expand Down Expand Up @@ -544,7 +544,7 @@ generate_tags![
noscript NoScript HtmlElement [],

/// The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code. The `<script>` element can also be used with other languages, such as WebGL's GLSL shader programming language and JSON.
script Script HtmlScriptElement [type_ "type", src, async_ "async", defer, cross_origin "crossOrigin", text, fetch_priority "fetchPriority", referrer_policy "referrerPolicy"],
script Script HtmlScriptElement [type_ "type", src, async_ "async", defer, cross_origin "crossOrigin", fetch_priority "fetchPriority", referrer_policy "referrerPolicy"],

// ==========================
// Demarcating Edits
Expand Down Expand Up @@ -619,7 +619,7 @@ generate_tags![
optgroup OptGroup HtmlOptGroupElement [disabled, label],

/// The `<option>` HTML element is used to define an item contained in a select, an optgroup, or a datalist element. As such, `<option>` can represent menu items in popups and other lists of items in an HTML document.
option_ Option HtmlOptionElement [default_selected "defaultSelected", disabled, selected, text, value],
option_ Option HtmlOptionElement [default_selected "defaultSelected", disabled, selected, value],

/// The `<output>` HTML element is a container element into which a site or app can inject the results of a calculation or the outcome of a user action.
output Output HtmlOutputElement [default_value "defaultValue", name, value],
Expand Down
6 changes: 3 additions & 3 deletions crates/core/src/web/widgets/ssr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ impl Element {
/// Be very careful when using this method. Always remember to
/// sanitize the input to avoid a cross-site scripting (XSS)
/// vulnerability.
pub fn set_inner_text<V>(&mut self, text: V)
pub fn set_text<V>(&mut self, text: V)
where
V: AttrValue + 'static,
{
Expand All @@ -258,11 +258,11 @@ impl Element {
/// Be very careful when using this method. Always remember to
/// sanitize the input to avoid a cross-site scripting (XSS)
/// vulnerability.
pub fn inner_text<V>(mut self, text: V) -> Self
pub fn text<V>(mut self, text: V) -> Self
where
V: AttrValue + 'static,
{
self.set_inner_text(text);
self.set_text(text);
self
}

Expand Down

0 comments on commit 674328a

Please sign in to comment.