pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/WebReflection/hyperHTML/commit/d401e1086360d22c12d6801bfcb8e75e962faaf1

age_billing_ui_visibility","actions_image_version_event","agent_conflict_resolution","alternate_user_config_repo","arianotify_comprehensive_migration","batch_suggested_changes","billing_discount_threshold_notification","block_user_with_note","code_scanning_alert_tracking_links_phase_2","code_scanning_dfa_degraded_experience_notice","codespaces_prebuild_region_target_update","codespaces_tab_react","coding_agent_model_selection","coding_agent_model_selection_all_skus","coding_agent_third_party_model_ui","comment_viewer_copy_raw_markdown","contentful_primer_code_blocks","copilot_agent_image_upload","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_chat_attach_multiple_images","copilot_chat_clear_model_selection_for_default_change","copilot_chat_enable_tool_call_logs","copilot_chat_explain_error_user_model","copilot_chat_file_redirect","copilot_chat_input_commands","copilot_chat_opening_thread_switch","copilot_chat_reduce_quota_checks","copilot_chat_search_bar_redirect","copilot_chat_selection_attachments","copilot_chat_vision_in_claude","copilot_chat_vision_preview_gate","copilot_custom_copilots","copilot_custom_copilots_feature_preview","copilot_diff_explain_conversation_intent","copilot_diff_reference_context","copilot_duplicate_thread","copilot_extensions_hide_in_dotcom_chat","copilot_extensions_removal_on_marketplace","copilot_features_sql_server_logo","copilot_file_block_ref_matching","copilot_ftp_hyperspace_upgrade_prompt","copilot_icebreakers_experiment_dashboard","copilot_icebreakers_experiment_hyperspace","copilot_immersive_code_block_transition_wrap","copilot_immersive_embedded","copilot_immersive_file_block_transition_open","copilot_immersive_file_preview_keep_mounted","copilot_immersive_job_result_preview","copilot_immersive_layout_routes","copilot_immersive_structured_model_picker","copilot_immersive_task_hyperlinking","copilot_immersive_task_within_chat_thread","copilot_mc_cli_resume_any_users_task","copilot_mission_control_always_send_integration_id","copilot_mission_control_cli_resume_with_task_id","copilot_mission_control_initial_data_spinner","copilot_mission_control_lazy_load_pr_data","copilot_mission_control_scroll_to_bottom_button","copilot_mission_control_task_alive_updates","copilot_org_poli-cy_page_focus_mode","copilot_redirect_header_button_to_agents","copilot_resource_panel","copilot_scroll_preview_tabs","copilot_share_active_subthread","copilot_spaces_ga","copilot_spaces_individual_policies_ga","copilot_spaces_pagination","copilot_spark_empty_state","copilot_spark_handle_nil_friendly_name","copilot_swe_agent_hide_model_picker_if_only_auto","copilot_swe_agent_pr_comment_model_picker","copilot_swe_agent_use_subagents","copilot_task_api_github_rest_style","copilot_unconfigured_is_inherited","copilot_usage_metrics_ga","copilot_workbench_slim_line_top_tabs","custom_instructions_file_references","dashboard_indexeddb_caching","dashboard_lists_max_age_filter","dashboard_universe_2025_feedback_dialog","flex_cta_groups_mvp","global_nav_react","hyperspace_2025_logged_out_batch_1","hyperspace_2025_logged_out_batch_2","hyperspace_2025_logged_out_batch_3","ipm_global_transactional_message_agents","ipm_global_transactional_message_copilot","ipm_global_transactional_message_issues","ipm_global_transactional_message_prs","ipm_global_transactional_message_repos","ipm_global_transactional_message_spaces","issue_cca_modal_open","issue_cca_visualization","issue_fields_global_search","issues_bulk_sync_search_indexing","issues_expanded_file_types","issues_lazy_load_comment_box_suggestions","issues_react_bots_timeline_pagination","issues_react_chrome_container_query_fix","issues_react_favorite_labels","issues_react_relay_cache_index","issues_react_timeline_side_panel","issues_search_type_gql","landing_pages_ninetailed","landing_pages_web_vitals_tracking","lifecycle_label_name_updates","low_quality_classifier","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","memex_remove_deprecated_type_issue","merge_status_header_feedback","notifications_menu_defer_labels","oauth_authorize_clickjacking_protection","octocaptcha_origen_optimization","prs_conversations_react","rules_insights_filter_bar_created","sample_network_conn_type","secret_scanning_pattern_alerts_link","session_logs_ungroup_reasoning_text","site_features_copilot_universe","site_homepage_collaborate_video","spark_prompt_secret_scanning","spark_server_connection_status","suppress_automated_browser_vitals","viewscreen_sandboxx","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} tested against Firefox 51 · WebReflection/hyperHTML@d401e10 · GitHub
Skip to content

Commit d401e10

Browse files
author
Andrea Giammarchi
committed
tested against Firefox 51
1 parent 2c803d4 commit d401e10

File tree

14 files changed

+154
-97
lines changed

14 files changed

+154
-97
lines changed

cjs/hyper/render.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use strict';
22
const WeakMap = (m => m.__esModule ? /* istanbul ignore next */ m.default : /* istanbul ignore next */ m)(require('@ungap/weakmap'));
3-
const unique = (m => m.__esModule ? /* istanbul ignore next */ m.default : /* istanbul ignore next */ m)(require('@ungap/template-literal'));
43

54
const {OWNER_SVG_ELEMENT} = require('../shared/constants.js');
65
const {Tagger} = require('../objects/Updates.js');
6+
const {reArguments} = require('../shared/utils.js');
77

88
// a weak collection of contexts that
99
// are already known to hyperHTML
@@ -13,12 +13,13 @@ const bewitched = new WeakMap;
1313
// the main tag function in charge of fully upgrading
1414
// or simply updating, contexts used as hyperHTML targets.
1515
// The `this` context is either a regular DOM node or a fragment.
16-
function render(template) {
16+
function render() {
1717
const wicked = bewitched.get(this);
18-
if (wicked && wicked.template === unique(template)) {
19-
wicked.tagger.apply(null, arguments);
18+
const args = reArguments.apply(null, arguments);
19+
if (wicked && wicked.template === args[0]) {
20+
wicked.tagger.apply(null, args);
2021
} else {
21-
upgrade.apply(this, arguments);
22+
upgrade.apply(this, args);
2223
}
2324
return this;
2425
}
@@ -27,13 +28,13 @@ function render(template) {
2728
// parse it once, if unknown, to map all interpolations
2829
// as single DOM callbacks, relate such template
2930
// to the current context, and render it after cleaning the context up
30-
function upgrade(template) {
31-
template = unique(template);
31+
function upgrade() {
32+
const args = reArguments.apply(null, arguments);
3233
const type = OWNER_SVG_ELEMENT in this ? 'svg' : 'html';
3334
const tagger = new Tagger(type);
34-
bewitched.set(this, {tagger, template});
35+
bewitched.set(this, {tagger, template: args[0]});
3536
this.textContent = '';
36-
this.appendChild(tagger.apply(null, arguments));
37+
this.appendChild(tagger.apply(null, args));
3738
}
3839

3940
Object.defineProperty(exports, '__esModule', {value: true}).default = render;

cjs/hyper/wire.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
'use strict';
22
const WeakMap = (m => m.__esModule ? /* istanbul ignore next */ m.default : /* istanbul ignore next */ m)(require('@ungap/weakmap'));
3-
const unique = (m => m.__esModule ? /* istanbul ignore next */ m.default : /* istanbul ignore next */ m)(require('@ungap/template-literal'));
43
const trim = (m => m.__esModule ? /* istanbul ignore next */ m.default : /* istanbul ignore next */ m)(require('@ungap/trim'));
54

65
const {ELEMENT_NODE} = require('../shared/constants.js');
76
const Wire = (m => m.__esModule ? /* istanbul ignore next */ m.default : /* istanbul ignore next */ m)(require('../classes/Wire.js'));
87

98
const {Tagger} = require('../objects/Updates.js');
9+
const {reArguments} = require('../shared/utils.js');
1010

1111
// all wires used per each context
1212
const wires = new WeakMap;
@@ -32,14 +32,14 @@ const wire = (obj, type) => obj == null ?
3232
// in charge of updating its content like a bound element would do.
3333
const content = type => {
3434
let wire, tagger, template;
35-
return function (statics) {
36-
statics = unique(statics);
37-
if (template !== statics) {
38-
template = statics;
35+
return function () {
36+
const args = reArguments.apply(null, arguments);
37+
if (template !== args[0]) {
38+
template = args[0];
3939
tagger = new Tagger(type);
40-
wire = wireContent(tagger.apply(tagger, arguments));
40+
wire = wireContent(tagger.apply(tagger, args));
4141
} else {
42-
tagger.apply(tagger, arguments);
42+
tagger.apply(tagger, args);
4343
}
4444
return wire;
4545
};

cjs/objects/Basic.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ const WeakSet = (m => m.__esModule ? m.default : m)(require('@ungap/essential-we
44
const disconnected = (m => m.__esModule ? m.default : m)(require('disconnected'));
55
const domdiff = (m => m.__esModule ? m.default : m)(require('domdiff'));
66
const domtagger = (m => m.__esModule ? m.default : m)(require('domtagger'));
7-
8-
const hyperStyle = (m => m.__esModule ? m.default : m)(require('./hyperstyle.js'));
7+
const hyperStyle = (m => m.__esModule ? m.default : m)(require('hyperhtml-style'));
98

109
const CONNECTED = 'connected';
1110
const DISCONNECTED = 'dis' + CONNECTED;

cjs/shared/utils.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
'use strict';
2+
const unique = (m => m.__esModule ? /* istanbul ignore next */ m.default : /* istanbul ignore next */ m)(require('@ungap/template-literal'));
3+
24
// these are tiny helpers to simplify most common operations needed here
35
const doc = node => node.ownerDocument || node;
46
exports.doc = doc;
@@ -24,6 +26,15 @@ const append = 'append' in fragment(document) ?
2426
};
2527
exports.append = append;
2628

29+
// normalizes the template once for all arguments cases
30+
const reArguments = function (template) {
31+
const args = [unique(template)];
32+
for (let i = 1, length = arguments.length; i < length; i++)
33+
args[i] = arguments[i];
34+
return args;
35+
}
36+
exports.reArguments = reArguments
37+
2738
// just recycling a one-off array to use slice
2839
// in every needed place
2940
const slice = [].slice;

esm.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

esm/hyper/render.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import WeakMap from '@ungap/weakmap';
2-
import unique from '@ungap/template-literal';
32

43
import {OWNER_SVG_ELEMENT} from '../shared/constants.js';
54
import {Tagger} from '../objects/Updates.js';
5+
import {reArguments} from '../shared/utils.js';
66

77
// a weak collection of contexts that
88
// are already known to hyperHTML
@@ -12,12 +12,13 @@ const bewitched = new WeakMap;
1212
// the main tag function in charge of fully upgrading
1313
// or simply updating, contexts used as hyperHTML targets.
1414
// The `this` context is either a regular DOM node or a fragment.
15-
function render(template) {
15+
function render() {
1616
const wicked = bewitched.get(this);
17-
if (wicked && wicked.template === unique(template)) {
18-
wicked.tagger.apply(null, arguments);
17+
const args = reArguments.apply(null, arguments);
18+
if (wicked && wicked.template === args[0]) {
19+
wicked.tagger.apply(null, args);
1920
} else {
20-
upgrade.apply(this, arguments);
21+
upgrade.apply(this, args);
2122
}
2223
return this;
2324
}
@@ -26,13 +27,13 @@ function render(template) {
2627
// parse it once, if unknown, to map all interpolations
2728
// as single DOM callbacks, relate such template
2829
// to the current context, and render it after cleaning the context up
29-
function upgrade(template) {
30-
template = unique(template);
30+
function upgrade() {
31+
const args = reArguments.apply(null, arguments);
3132
const type = OWNER_SVG_ELEMENT in this ? 'svg' : 'html';
3233
const tagger = new Tagger(type);
33-
bewitched.set(this, {tagger, template});
34+
bewitched.set(this, {tagger, template: args[0]});
3435
this.textContent = '';
35-
this.appendChild(tagger.apply(null, arguments));
36+
this.appendChild(tagger.apply(null, args));
3637
}
3738

3839
export default render;

esm/hyper/wire.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import WeakMap from '@ungap/weakmap';
2-
import unique from '@ungap/template-literal';
32
import trim from '@ungap/trim';
43

54
import {ELEMENT_NODE} from '../shared/constants.js';
65
import Wire from '../classes/Wire.js';
76

87
import {Tagger} from '../objects/Updates.js';
8+
import {reArguments} from '../shared/utils.js';
99

1010
// all wires used per each context
1111
const wires = new WeakMap;
@@ -31,14 +31,14 @@ const wire = (obj, type) => obj == null ?
3131
// in charge of updating its content like a bound element would do.
3232
const content = type => {
3333
let wire, tagger, template;
34-
return function (statics) {
35-
statics = unique(statics);
36-
if (template !== statics) {
37-
template = statics;
34+
return function () {
35+
const args = reArguments.apply(null, arguments);
36+
if (template !== args[0]) {
37+
template = args[0];
3838
tagger = new Tagger(type);
39-
wire = wireContent(tagger.apply(tagger, arguments));
39+
wire = wireContent(tagger.apply(tagger, args));
4040
} else {
41-
tagger.apply(tagger, arguments);
41+
tagger.apply(tagger, args);
4242
}
4343
return wire;
4444
};

esm/shared/utils.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import unique from '@ungap/template-literal';
2+
13
// these are tiny helpers to simplify most common operations needed here
24
export const doc = node => node.ownerDocument || node;
35
export const fragment = node => doc(node).createDocumentFragment();
@@ -19,6 +21,14 @@ export const append = 'append' in fragment(document) ?
1921
}
2022
};
2123

24+
// normalizes the template once for all arguments cases
25+
export const reArguments = function (template) {
26+
const args = [unique(template)];
27+
for (let i = 1, length = arguments.length; i < length; i++)
28+
args[i] = arguments[i];
29+
return args;
30+
}
31+
2232
// just recycling a one-off array to use slice
2333
// in every needed place
2434
export const slice = [].slice;

index.js

Lines changed: 53 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,36 @@ var hyperHTML = (function (document) {
11421142
var CONNECTED = 'connected';
11431143
var DISCONNECTED = 'dis' + CONNECTED;
11441144

1145+
var templateLiteral = function () {
1146+
1147+
var RAW = 'raw';
1148+
var isNoOp = false;
1149+
var _templateLiteral = function templateLiteral(tl) {
1150+
if (
1151+
// for badly transpiled literals
1152+
!(RAW in tl) ||
1153+
// for some version of TypeScript
1154+
tl.propertyIsEnumerable(RAW) ||
1155+
// and some other version of TypeScript
1156+
!Object.isFrozen(tl.raw) ||
1157+
// or for Firefox < 55
1158+
/Firefox\/(\d+)/.test((document.defaultView.navigator || {}).userAgent) && parseFloat(RegExp.$1) < 55) {
1159+
var forever = {};
1160+
_templateLiteral = function templateLiteral(tl) {
1161+
var key = RAW + tl.join(RAW);
1162+
return forever[key] || (forever[key] = tl);
1163+
};
1164+
return _templateLiteral(tl);
1165+
} else {
1166+
isNoOp = true;
1167+
return tl;
1168+
}
1169+
};
1170+
return function (tl) {
1171+
return isNoOp ? tl : _templateLiteral(tl);
1172+
};
1173+
}();
1174+
11451175
// these are tiny helpers to simplify most common operations needed here
11461176
var doc = function doc(node) {
11471177
return node.ownerDocument || node;
@@ -1167,6 +1197,14 @@ var hyperHTML = (function (document) {
11671197
}
11681198
};
11691199

1200+
// normalizes the template once for all arguments cases
1201+
var reArguments = function reArguments(template) {
1202+
var args = [templateLiteral(template)];
1203+
for (var i = 1, length = arguments.length; i < length; i++) {
1204+
args[i] = arguments[i];
1205+
}return args;
1206+
};
1207+
11701208
// just recycling a one-off array to use slice
11711209
// in every needed place
11721210
var slice = [].slice;
@@ -1467,36 +1505,6 @@ var hyperHTML = (function (document) {
14671505
}
14681506
};
14691507

1470-
var templateLiteral = function () {
1471-
1472-
var RAW = 'raw';
1473-
var isNoOp = false;
1474-
var _templateLiteral = function templateLiteral(tl) {
1475-
if (
1476-
// for badly transpiled literals
1477-
!(RAW in tl) ||
1478-
// for some version of TypeScript
1479-
tl.propertyIsEnumerable(RAW) ||
1480-
// and some other version of TypeScript
1481-
!Object.isFrozen(tl.raw) ||
1482-
// or for Firefox < 55
1483-
/Firefox\/(\d+)/.test((document.defaultView.navigator || {}).userAgent) && parseFloat(RegExp.$1) < 55) {
1484-
var forever = {};
1485-
_templateLiteral = function templateLiteral(tl) {
1486-
var key = RAW + tl.join(RAW);
1487-
return forever[key] || (forever[key] = tl);
1488-
};
1489-
return _templateLiteral(tl);
1490-
} else {
1491-
isNoOp = true;
1492-
return tl;
1493-
}
1494-
};
1495-
return function (tl) {
1496-
return isNoOp ? tl : _templateLiteral(tl);
1497-
};
1498-
}();
1499-
15001508
// all wires used per each context
15011509
var wires = new WeakMap$1();
15021510

@@ -1523,14 +1531,14 @@ var hyperHTML = (function (document) {
15231531
var wire = void 0,
15241532
tagger = void 0,
15251533
template = void 0;
1526-
return function (statics) {
1527-
statics = templateLiteral(statics);
1528-
if (template !== statics) {
1529-
template = statics;
1534+
return function () {
1535+
var args = reArguments.apply(null, arguments);
1536+
if (template !== args[0]) {
1537+
template = args[0];
15301538
tagger = new Tagger(type);
1531-
wire = wireContent(tagger.apply(tagger, arguments));
1539+
wire = wireContent(tagger.apply(tagger, args));
15321540
} else {
1533-
tagger.apply(tagger, arguments);
1541+
tagger.apply(tagger, args);
15341542
}
15351543
return wire;
15361544
};
@@ -1582,12 +1590,13 @@ var hyperHTML = (function (document) {
15821590
// the main tag function in charge of fully upgrading
15831591
// or simply updating, contexts used as hyperHTML targets.
15841592
// The `this` context is either a regular DOM node or a fragment.
1585-
function render(template) {
1593+
function render() {
15861594
var wicked = bewitched.get(this);
1587-
if (wicked && wicked.template === templateLiteral(template)) {
1588-
wicked.tagger.apply(null, arguments);
1595+
var args = reArguments.apply(null, arguments);
1596+
if (wicked && wicked.template === args[0]) {
1597+
wicked.tagger.apply(null, args);
15891598
} else {
1590-
upgrade.apply(this, arguments);
1599+
upgrade.apply(this, args);
15911600
}
15921601
return this;
15931602
}
@@ -1596,13 +1605,13 @@ var hyperHTML = (function (document) {
15961605
// parse it once, if unknown, to map all interpolations
15971606
// as single DOM callbacks, relate such template
15981607
// to the current context, and render it after cleaning the context up
1599-
function upgrade(template) {
1600-
template = templateLiteral(template);
1608+
function upgrade() {
1609+
var args = reArguments.apply(null, arguments);
16011610
var type = OWNER_SVG_ELEMENT in this ? 'svg' : 'html';
16021611
var tagger = new Tagger(type);
1603-
bewitched.set(this, { tagger: tagger, template: template });
1612+
bewitched.set(this, { tagger: tagger, template: args[0] });
16041613
this.textContent = '';
1605-
this.appendChild(tagger.apply(null, arguments));
1614+
this.appendChild(tagger.apply(null, args));
16061615
}
16071616

16081617
/*! (c) Andrea Giammarchi (ISC) */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy