ToCode
Open in Telegram
××פ×× ×§×¦×Ø×× ×××Ŗ×× ×Ŗ×× ×××Ŗ ×× ×× ×¤×Ø×§
Show more1 419
Subscribers
No data24 hours
No data7 days
+130 days
Posts Archive
1 419
# ש×××©× × ××”×× ×©××Ŗ× ×××××× ××× ××Ŗ ××× ××××¢× ×××× ×
××ר××Ŗ ש×× × ×× ×××× ××Ŗ ××”×× ××, ×× ×פשר ×××Ŗ×××× ×¢× ×פת×× ×××©× ×©×××ר שע×××£ ×××× ×× ××× ×××× ××שר ××Ŗ×Ŗ ×× ××. ×××××× ××Ŗ ××ש×× ×××× ××פשרת ××× ××× ×××ש×× ××שת×ש ×× ××× ×©×רצ×.
××××Ŗ× ×××¤× ×× ×× × ××ש××× ×¢× ××××× ××× × ××”×× ×××× ××”×£. ×××”×£ ×××× ×¦××Ø× ××××× ××× ××” ×××× ××¢××ר ×× × ××ר×××× ×¢×× ××¢×× ××”×£ ××××Ø× ×××. ×××§ ××× ××”×× ×©× ××¢××× ×××××Ø× × ×× ×§×©×× ××ש×× ××קר××: × ××"×, ×Ŗ××ר ××§××× ×× ×××Ŗ× ×××§, ×××× ××××× ×¢×Ø× ×ש××¢××Ŗ× ×××¢××× ×©××× ××× ××× ××× ××רש ××©×§×¢× ×ש××¢××Ŗ××Ŗ ×××”×£ ××××× ××¤× × ×©××Ŗ××××× ×ר×××Ŗ ×Ŗ×צ×××Ŗ.
××× ×××× ××Ø× × ××××××× ×××××Ø× ××Ŗ ××צר×× ×× ×”×× ××ש ×©× × ××”××, × ××”×× ×©××רש×× ××¢× ×××× ××©×§×¢× ×הפ××Ŗ ×ש×× ××× ×××× ××× ××Ŗ ××××Ø× ××× ×××××Ŗ. ×× × ×©××ש ×××××××Ŗ ×× ××”×× ×××× ×©×××× ×× ××פ×× ××Ŗ×× ×עש×ר×× ××× ××××× ××¢××Ø× ×××צר ×××× ××תר × ××××:
## קשר××
××× ×××××××× ××פ×× ×©×©××¢×Ŗ× ××קשר ××× ××× Connection Economy ש×× ×××”××ר שקשר×× ×¢× ×× ×©×× ××ר×× ×פ×× ×× ××” ××××× ××× ××ר. ××¢××× ×××× ××Ø× × ×× ×× × ×××××× ××צ×ר קשר×× ×קצ××¢××× ××¢×× ×ש××¢××Ŗ ×¢× ××××Ŗ עצ××× ×©× ×× ×©××, ××ר×× ×¤×¢××× ×פ××× ××× ×פ××ש ×××Ŗ× ×¤× ×× ×× ×¤× ××. ×¤× ××רׄ ×××¦× ×פ××× ××תר ××צ×× ×× ××ר××§×× ×§×× ×× ××ש ×ר×× ×§×××××Ŗ ×××§××Ŗ ש×××צר××Ŗ ×פ×ש×× ×¤××××× ×××ר××.
ר×× ××× ×©×× ×”××××× ××קפ×× ×× ×××× ×××× ×”××£ פ×רה××××Ŗ ×××ר × ×××× × ×××××× ×רעש ש×××. ××¢×××Ŗ ×××Ŗ ר××× × ×©×××× ××§×× ××××¦× ×××ר ×¢× ××צר ש××× ××× ×× ×¢× ××¢× ×קצ××¢ שע×ר ××. הפצ×פ××Ŗ ××¢××× ×פ××Ŗ××, ×× ×××Ŗ פר×××§×-×¦× ×¢× ×¢×× ×× ×©××, ×פ×ש ××× ×” ×××¢×רת ×רצ××, ×× ×פ××× ×¢××Ø× ××§××צת פ×××”×××§ ×××××× ××¢××ר ××× ×©×× ××××ר ××Ŗ×× ×קצ××¢××Ŗ. ××¢×Ŗ×× ×ש×× ×צ×ר×× ××¢× ×קצ××¢ ×× ×××¤×©× ×××××” ×¢××× ××Ŗ× ×Ŗ×§×¤×¦× ×ר×ש ×רש×××.
×××Ø× ××× ×××× ××¤×Ŗ× ×§×©×Ø×× ××× ×¤×©×× ××¢××ר ×קצ××¢××Ŗ ××× ×©×× ××× ××××× ××Ŗ ש×ש ×××, ××××צר ×¢×× ××¢×× ××××× ××××Ŗ ×××× - ×× ×× ××××Ŗ ××× ×”××, ××צ×רף ×פ××Ŗ×× ×©× ×¤×Ø×××§× ×§×× ×¤×Ŗ×× ×©×§×Ø×× ×××××, ×××§×× ×ער××Ŗ ×××Ŗ× ××××Ŗ שתפת×ר ××¢×× ××ר××× ×©×§×Ø×× ×××××, ××¢××ר ××§××צ××Ŗ פ×××”×××§ ××××ר×, ××§×צ×ר ××פש ×ר××× ××¢×××× ×קצ××¢××Ŗ ×¢× ××¢×××× ×©×× ×× ×ר×××× ×©× ×× ×©××.
## ××××× ××Ŗ ××× ××Ŗ
×¢××× ××¢×××× ×××¤× × ××©×Ŗ× ××קצ××¢× ××תר ×××תר ×× ×©× × ×××ר××©× ××פת××× ×קצ××¢××× ×Ø×§ ××××. ××××Ŗ× ××× ××× ×הפ××§ ×× ×©×× ×©×××× ×× ××שק××¢ ×הפ××§ ×פ××Ŗ×× ×××××× ××Ŗ ××קצ××¢××Ŗ ש×××. ×× × ×צר ××¦× ×©××¦× ××× ×ש ×××× ×'×× ××ר×× ×©××פש×× ×¢×××× ××××××§ ×××¦× ×©× × ×ש ×××× ×שר××Ŗ ×¤× ××××Ŗ ש××ר××Ŗ ×× ×צ×××××Ŗ ××××ש ×× "××× ×× ×©×× ×××××".
×פשר ×××××× ××Ŗ ×¢×××× ××××××§ ×פ××× ×¦××××× ××”××ר×× ×פ×ר×××× ××שר ××Ŗ××Ŗ××Ŗ ×פ×ר×××× ×× ×× × ××צ××× ×'×× ××ר×× ××× ×©×× ××× × ××”××× ×××× ×©×¢×××× ×ר××Ŗ ×××××× ××Ŗ ×ש פ×××Ŗ ×× ×©×× ××Ŗ×××××.
××©×§×¢× ×××××× ××Ŗ ×××צע××Ŗ ××××× ×§×רה, ××צ××¢ פר×××§×-×¦× ×××× ×××××× ××ש×, ×שתתפ××Ŗ ×פר×××§× ×§××-פת×× ×ר××× ××¢××× ××Ŗ××× ×©×××, ××Ŗ××§×××Ŗ ××¢××× ×Ŗ××× ×”×¤×¦××¤× ××××ר××Ŗ ×¢× ×× ×× ×©×§××Ø× ×× ×× ××× ××Ø× ××רת ×Ŗ×¢××ר ××× ××¢×××Ŗ ש×××× ×פ×ר××××. ××××× ××Ŗ ××× ××Ŗ ××× × ××”, ×× ××× ×Ŗ×פשר ××× ×Ŗ××× ××צ×× ×¢×××× ××Ŗ× ××× ×©××Ŗ××××× ×××.
## ×× ×××Ŗ פר×××§× SaaS ×××××Ŗ
× ××” ש×××©× ×©××Ŗ× ×××××× ××× ××Ŗ ××××Ø× ××× (××× ×××¢×Ŗ× ××× ××§×©× ×××תר) ××× ×ער××Ŗ ×Ŗ××× × ×©×× ×©×× ××ר×× ×××× ×××× ×× ×ש×× ×¢×××. ××Ŗ× ×× ×¦×Ø×××× ×××Ŗ×ר××Ŗ ××××× ×× ×פ×××”×××§, ×הפ××§ ××××ר × ××©× ×©××£ ××רת ×”××ר×-×פ ×× ×¢× ×§××Ŗ ××× ×××××× ×× ××Ŗ×¢× ××× ×Ŗ ××, ×פת×ר ××× ×©×× ××¢×× ×”×¤×¦×פ××Ŗ ×××צ××¢ ×××ר ××רק××××.
×הפר Start Small Stay Small ×צ××¢ ××”××× ×ש××× ×××× ××× × ×פ××Ŗ×× ×¤×Ø×××§× Saas ×¢××ר ××Ŗ×× ×Ŗ×× ×©×Ø×צ×× ××צ××× ××××××Ŗ עצ×× ××× × ×××× ××××ׄ ×קר×× ×××Ŗ× ×× ×× ×ש×× ×©×××ר ×××××.
××תר Indie Hackers ×פשר ××צ×× ××× ×”××£ ×”×פ×ר×× ×¢× ×¤×Ø×××§××× ×§×× ×× ×©×× ××¢× ××× ××פשר×× ××פת××× ×©××× ×××××Ŗ ××××× ×Ø×§ ××××× ×”××Ŗ ××××Ŗ× ×¤×Ø×××§×.
× ××” ×Ŗ××× × ×©××× ×××× ×× ×¤×××Ŗ ××× ×× ××Ŗ פ××××Ŗ, ××× ××× ×× ×©×× ×××¢× ×× ××רשת ××©×§×¢× ×הפ××Ŗ ××× ×× ×©×× ×¢××××× ×××××× ××שק××¢ ×× ××” ××× ×שע××Ŗ ××¤× ××.
×ש ××× ×Ø×¢××× ××Ŗ ×× ××”×× × ×הפ×× ×©×× ×× × ×××××× ××¤×Ŗ× ××× ×××××Ŗ? ××××× ×× ×××× ×שתף ××Ŗ×××××Ŗ.
1 419
const newTreeData = await loadChildren(treeData, key, children);
setTreeData(newTreeData);
};
return (
<Tree loadData={onLoadData} treeData={treeData} />
);
}
## ×××¤× ××××× ×¢××
×עׄ ×©× antd ×ש ×¢×× ×××× ××××××Ŗ ××פשר ×קר×× ×¢×××× ×¢× ×××××××Ŗ ×××£ ××Ŗ××¢×× ×©× ×עׄ ×××:
https://ant.design/components/tree/
×××××§ ×××תר ××¢× ××× ×××£ ××× ×Ø×©×××Ŗ ××§××פ×× × ×××Ŗ ××¦× ×©×××. פש×× ×Ŗ×××¦× ×¢× ×× ×§××פ×× × ×× ××רש××× ××× ×ר×××Ŗ ×× ××× ×¢××©× ×××× ××שת×ש ××.1 419
# ×ש××§×× ×¢× Antd - ×§××פ×× × ××Ŗ עׄ ××”×× ×ר×× ××Ŗ
הפר×××Ŗ antd ××× ×××Ŗ ×הפר×××Ŗ × UI ×פ×פ××ר×××Ŗ ×ר×××§× ××× × ××××Ø× ×××× ×××. × API ×××× ×¤×©××, ×ש ×ר×× ×§××פ×× × ×××Ŗ ×©× ×Ø×××Ŗ ××× ××פשר ××ר××× ×××Ŗ× ×××”××Ŗ ××§×××Ŗ. ×× × ××××× ××§××פ×× × ×× ×©× ×עׄ ש××× ××ש×××ש ××”×× ×ר×× × ×× ××× ××××¦× ××××¢ ×©× ××¢× ×שרת.
## ×× ×× ×× × ××× ××
×××××× ×©× ×××× ×Ŗ×©×Ŗ×ש ××§××פ×× × ××Ŗ Tree ×©× antd ××× ××ר×××Ŗ עׄ ש×צ×× ××Ŗ ×× ×הר××× ×©× ×××××Ŗ ×××××××, ××ש×××צ×× ×¢× ×”×Ø× ××× ×××¢× ××Ŗ ש×××Ŗ ×× ×××××××Ŗ ××××Ŗ× ×”×Ø× ××צ×× ×××Ŗ× ××Ŗ×ר ××××× ×עׄ. ××× ×× × ×Ø×× ××¢××× ××§×××”× ××××§×”:
<iframe src="https://codesandbox.io/embed/fervent-robinson-bse0b?fontsize=14&hidenavigation=1&module=%2Fsrc%2FApp.js&theme=light"
style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;"
title="fervent-robinson-bse0b"
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe>
## ××× ×× ×× ×¢×„
×ש××× ××צ×× ×¢×„ ×¢× ×§××פ×× × ××Ŗ עׄ ×©× antd ×× ×× × ×¦×Ø×××× ××× × × ×Ŗ×× ×× ×©×××× ××¢×Ø× ×©× ×××××§×××, ××שר ××× ×××××§× ×ש ××פ××× key ××××××, ××פ××× title ××פצ××× ××× ×©×××× ××Ŗ ×××§×”× ×©× ××××××§× ×××פ××× children ××פצ××× ××× ×©×××× ××Ŗ ×× ××××××. ×× ××Ŗ× ××××¢×× ×©×× ×××× ××××× ×צ×××Ŗ ××”××× ×פשר ××××”××£ ××פ××× isLeaf ×¢× ××¢×Ø× true. ××××××§× ××× ××××¦× ×¢×„ ××××××:
[
{ key: 'a', title: 'A', children: [] },
{ key: 'b', title: 'B', children: [
{ key: 'bb', title: 'B-1', isLeaf: true },
{ key: 'bc', title: 'B-2', isLeaf: true },
}}
];
×× ××”×× ×©×× ×Ø×¦××Ŗ× ××ר×××Ŗ עׄ ×©× ×”×Ø××× ×× ×©×ר×× ×××צ×× ××Ŗ ×××תר ×Ŗ××× ×Ø×©××× ×©× ×”×Ø××× ×××× ×”×Ø× ×××××× ×××× ×××××××Ŗ ש××פ××¢××Ŗ ××××Ŗ× ×”×Ø×. ×ש××× ××× ××Ŗ ××Ŗ ×עׄ ×× × ××Ŗ××× ×¢× ×Ø×©×××Ŗ ×הר××× ×©× ×צ××Ŗ ××§×ש×ר https://swapi.py4e.com/api/films/, ××× ×פע×× ××Ŗ ×פ×× ×§×¦×× ×××× ××× ××פ×× ××Ŗ ×רש××× ×עׄ:
function initTree(films) {
return films.map((film) => ({
key: `film-${film.episode_id}`,
title: film.title,
children: film.characters.map((url) => ({
key: url,
isLeaf: true,
})),
}));
}
## ×× ×§××Ø× ×ש×שת×ש ×××ׄ ×¢× ×”×Ø×
×¢×ש×× ×©×ש ×× × ××Ŗ ×ר×× ×©× ×הר××× ×פשר ×××ש×× ××ר×××Ŗ ×× ×§××Ø× ×ש×שת×ש ×××ׄ ×¢× ×”×Ø×. ×תש××× ××× ×©×× ×× × ×¦×Ø×××× ××צ×ר ××Ŗ ×× × ×Ŗ×× × ×עׄ ×××ש ×¢× ×עׄ ×××¢××××. ××¢×××× ×¢× ××× × × ×Ŗ×× ×× ××ר×××× ×©×¦×Ø×××× ×××ש×ר ××”×××× ×× × ×××× ××שת×ש ×הפר×× immer ×©× ××Ŗ× ×Ŗ ×× ××שת ×××× × ×× ×Ŗ×× ×× ××× ×©××××Ŗ× ×××Ŗ× JavaScript ר××× ×××פ××Ŗ ××Ŗ ××§×× ××××©× Immutable, ××××ר ×××××Ø× ××× × × ×Ŗ×× ×× ××ש רק ×¢× ×ש×× ×××× ×©××צעת×. ××¢×רת immer ××Ŗ××Ŗ× ××Ŗ ×©×Ŗ× ×פ×× ×§×¦×××Ŗ ×××××Ŗ ש×××§×××Ŗ עׄ ×××¤×Ŗ× ×©× ×”×Ø× ×××××××Ŗ ××Ŗ ×××××× ×©× ××”×Ø× ×× ×Ŗ×× × ×××××××Ŗ ×××××Ŗ×××Ŗ ××××Ŗ× ×הר×:
async function loadCharacter(node) {
const res = await fetch(node.key);
const data = await res.json();
return { key: node.key, title: data.name, isLeaf: true };
}
async function loadChildren(treeData, filmKey, children) {
return produce(treeData, async (draft) => {
const node = draft.find((n) => n.key === filmKey);
node.children = await Promise.all(children.map(loadCharacter));
});
}
×× ×¢××× ×× ×©××Ø× × ××ר ×§××× × children ×©× ×× ×”×Ø× ×Ø×©××× ×©× ××××× ×©×××¤×Ŗ× ×©× ×× ××× ××× ×××××§ × URL ×©× ×××××Ŗ. ×× × ×שת×ש ××× × Promise.all ××× ×××××× ××× ×©×× ×קש××Ŗ ×רשת ××ש××× ×××§××× ××× ×××Ŗ ×××Ø× ××©× ××.
××××§ ×××ר×× ×©× ×©×ר ××§×× ××× ××§××פ×× × ×× ×¢×¦×× ×©×××××§× ××Ŗ ×× ×פ×× ×§×¦×××Ŗ ש××Ŗ×× × ×××× × ×Ø×××Ŗ ××:
import React, { useState, useEffect } from 'react';
import produce from "immer"
import { Tree } from 'antd';
import 'antd/dist/antd.css';
export default function Demo() {
const [treeData, setTreeData] = useState(initTreeData);
useEffect(() => {
async function flow() {
const res = await fetch('https://swapi.py4e.com/api/films/');
const data = await res.json();
setTreeData(initTree(data.results));
};
flow();
}, []);
const onLoadData = async ({ key, children }) => {1 419
npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See /Users/ynonp/.npm/eresolve-report.txt for a full report. npm ERR! A complete log of this run can be found in: npm ERR! /Users/ynonp/.npm/_logs/2021-12-16T20_16_00_413Z-debug.logר×××× ×× ×××¢×× ×××? × ××× ×© npm install × ×ש×, ××× ××× ×× ×צ××¢ ×©× × ×¤×תר×× ××Ŗ ש××Ŗ ×©× ××× ×× ×©×× × ×××× ××פע×× ×××¢× ××× ××ש××. ××××ר ×××Ø× ×©××ש×× ×©×Ø××¦× ××שת×ש ×הפר×× ×©××× ×Ø××× ××××¢× ××××Ŗ ×××× ×”××× ×§× ×ר×ש×× ××× ×× ×”××Ŗ ××פע××:
$ npm install --force
ש××××× ×¢××× ×¢× Warnings, ×××Ŗ×§×× ××Ŗ ×××Ø×”× 16.8.1 ×©× ×Ø×××§× ××Ŗ××§×××Ŗ node_modules ×ר×ש××Ŗ ××× ××Ŗ×§×× ××× ××Ŗ ×××Ø×”× 17:
$ npm ls react
myapp@1.0.0 /Users/ynonp/tmp/mynpm/myapp
āā⬠mylib@1.0.2
ā āāā react@16.8.1 deduped invalid: "^17.0.2" from node_modules/mylib
āāā react@16.8.1 invalid: "^17.0.2" from node_modules/mylib
npm ERR! code ELSPROBLEMS
npm ERR! invalid: react@16.8.1 /Users/ynonp/tmp/mynpm/myapp/node_modules/react
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/ynonp/.npm/_logs/2021-12-16T20_18_56_638Z-debug.log
×× × ××× ×× ×פשר ×××ר×× ××ש×× ××שת×ש ××××Ø×”× ×©×× ×©× ×”×¤×Ø××, ××× ×× ×ש ×××× ××××× ××× ×××××Ŗ ×× ××ש×× ××Ŗ×§×× ×××Ø×”× ×©×× ×××צת ×¢××× ××××× ×× ××§×× ×× ×¢×××. ×× × ×× ×©×ש×× ××××ר:
1. ×××××Ø× ××Ŗ ×××ר×× ×©××Ŗ× ×Ø×צ×× ×©××ר×× ××Ŗ×§×× × ××Ŗ×ר Peer Dependencies.
2. ×× ×§×× ××§×× ×©×שת×ש ×הפר×× ×× ×¢×××, ×שת××©× × npm ls ××× ××××× ×©××Ŗ×××××Ŗ שרצ××Ŗ× ××××Ŗ ×××Ŗ×§× ××Ŗ ××× ×©×¦×Ø××.
3. ×Ŗ×§× × ××Ŗ ××Ŗ×××××Ŗ ××× ×Ŗ×©×Ŗ××©× × --force, ×פ××× ×©×× ×¢×××.1 419
# ×××× ××××Ŗ×: ×× ×פשר ×××ר×× ××§×× ×××Ŗ×§×× ×”×¤×Ø×××Ŗ Node.JS (××× ×פשר ×××Ŗ×§×Ø× ×××)
××× ×©×××× ×× ××תר ××× ××× ××××××× ×××ר×× ×× ×××× ×××Ŗ× ××§× ×ש×× ×¢× npm ×××¢×קר ×¢× ××Ŗ×× ×Ŗ×× ×× ×× × ×××Ŗ× ××× ××× ×× ×ש××× ×××Ŗ×§××× ×××× ×××”×× ××× ×¤××××××Ŗ ×××××Ŗ.
××”×פ×ר ××× ×¤×©×× - ×× ××Ŗ× ×××Ŗ××× ×××××Ŗ Node.JS ×× ××Ŗ× ×××××× ×צ××× 3 רש××××Ŗ ×©× ×Ŗ×××××Ŗ × package.json ש×××:
1. רש×××Ŗ dependencies ×××××Ø× ×Ø×©××× ×©× ×”×¤×Ø×××Ŗ ש××Ŗ× ××רש×× ×©×××§×× ××Ŗ×§×× ×”×¤×¦×פ××Ŗ ×¢××ר×× ×ש××× ××Ŗ×§×× ××Ŗ ×הפר×× ×©×××.
2. רש×××Ŗ peerDependencies ×××××Ø× ×Ø×©××× ×©× ×”×¤×Ø×××Ŗ ש××Ŗ× ××רש×× ×©"×××× ×©×" ×ש××§×× ××Ŗ×§×× ××Ŗ ×הפר×× ×©×××, ××××ר הפר×××Ŗ ש×× ××Ŗ× ×שת×ש×× ××× ××× ×§×× ×××§×× ×שת×ש ×××.
3. רש×××Ŗ devDependencies ×××××Ø× ×Ø×©××× ×©× ×Ŗ×××××Ŗ שרק ××Ŗ× ××Ŗ×§×× ×× ×××¦× ×¤××Ŗ××.
×× ×¢×ש×× ×××× × ××××§ ×× ×§××Ø× ×××××× ×ש×× × ××× × ×”×¤×Ø×× ×©×שת×שת ×ר×××§× 17 ×צר××× ×©×××§×× ××Ŗ×§×× ××Ŗ ר×××§× 17 ××× ××¢××× ×××Ŗ×.
## ש×××ש × devDependencies
×× ×× × ××××ר ××Ŗ ר×××§× ××Ŗ×ר devDependency ×××צע××Ŗ ×××××§ ××× ××§××ׄ package.json ×הפר×× ×©××:
"devDependencies": {
"react": "^17.0.2"
}
×× ×ש×× × ××¢×× ××Ŗ ×הפר×× × npm ×××ש×× ××ר ×פע×× npm install ×¢×××, ×××Ŗ× ××ש×× ××ר ×× ××§×× ××Ŗ react ××××. ר×××§× ×××Ŗ× ×ש×××ש רק ×××× ×©×¤××Ŗ××Ŗ× ××Ŗ ×הפר×× ××× ×××× ×ש×××ש ××.
## ש×××ש × dependencies
×× ×× × ××××ר ××Ŗ ר×××§× ××Ŗ×ר dependency ×××צע××Ŗ ×××××§ ××× ××§××ׄ package.json ×הפר×× ×©××:
"dependencies": {
"react": "^17.0.2"
}
×× ×××§×× ×©××Ŗ×§×× ××Ŗ ×הפר×× ×©×× ××§×× ××Ŗ××§×××Ŗ node_modules ש×× ××Ŗ ×הפר×××Ŗ ×××××Ŗ:
node_modules
āāā js-tokens
āāā loose-envify
āāā mylib
āāā object-assign
āāā react
××× ××ר × ×Ø×× ×××! ××××ר ×××§×× ×§××× ×× ××Ŗ ר×××§× ××× ××Ŗ ×× ×הפר×××Ŗ שר×××§× ×Ŗ×××× ×××. ××× ×××× ××¦× × ××Ŗ ×××Ŗ×××××Ŗ. ×× ×¢××× ×Ø×§ ×××× ×©×××§×× ×Ŗ××× ×Ø×§ ×הפר×× ×©××. ×× ××× ×××”××£ ×Ŗ×××Ŗ ×הפר×× ×©×¦×Ø××× ×××Ø×”× ××©× × ××תר ×©× ×Ø×××§×, ×× ×פ××× ×Ŗ×××Ŗ הפצ×פ××Ŗ ××××Ø×”× ××©× × ××תר ×©× ×Ø×××§× ××××× ×××××× ×××”×Ŗ××.
× × ×× ×©×§×× ×××§×× ×©×× ×××× ××Ŗ ×××××§ ××× ××§××ׄ package.json ש××:
"dependencies": {
"mylib": "file:../mylib/mylib-1.0.1.tgz",
"react": "16.8.1"
}
×× ×¢×ש×× ××פע×× ×©× npm install ××× ××§×× ××Ŗ××§×××Ŗ node_modules ××Ŗ:
node_modules
āāā js-tokens
āāā loose-envify
āāā mylib
āāā object-assign
āāā prop-types
āāā react
āāā react-is
āāā scheduler
ש×× × ×Ø×× ××××× ×× ××× ×× ××× ××Ŗ×§×× ××Ŗ ר×××§× ××× ××××Ŗ ש××× ××Ŗ×§×× ×©×Ŗ× ××רה×××Ŗ ×©× ×Ø×××§×:
$ npm ls react
myapp@1.0.0 /Users/ynonp/tmp/mynpm/myapp
āā⬠mylib@1.0.1
ā āāā react@17.0.2
āāā react@16.8.1
×××××Ŗ ××Ŗ×× ×Ŗ××§×××Ŗ node_modules/mylib ×× × ×××¦× ×Ŗ××§×××Ŗ node_modules × ×הפת ש××Ŗ××× ×ש ××Ŗ ר×××§× ××××Ø×”× 17.0.2, ×××Ŗ××§×××Ŗ node_modules ×ר×ש××Ŗ ×× × ×××¦× ××Ŗ ר×××§× ××××Ø×”× 16.8.1.
××× ×××רת dependencies ×× ××××Ŗ ××פשרת ×× "×××ר××" ××§×× ×××Ŗ×§×× ×”×¤×Ø×× ××××Ø×”× ××”××××Ŗ. ×× ×”×¤×Ø×× ××רת ש××× ×Ŗ××× ××, ×× ××× ×¢×¦××, ××קש×× ×××Ø×”× ××רת ×× ×× ×Ŗ×§×× ×¢××פ××Ŗ ×××××Ø×”× ×©×× × ×Ŗ××× ×× ×Ŗ××Ŗ×§× ×צ××Ø× ×¤×Ø×××Ŗ × node_modules ×©× ×הפר×× ×©××.
## ש×××ש × peerDependencies
××פצ×××Ŗ peerDependencies ×××Ŗ× ×¦×Ø××× ×××××Ŗ ×ר×ש×× × ×× ××”×× ×× ××¤× ××Ŗ××¢×× ××× ×¢××©× ×××××§ ××Ŗ ×× ×©×× ×× × ××פש××. ××× ×××××Ø× ×©×× × ×Ŗ××× ×הפר×× ××רת ××× ×Ŗ×××Ŗ צ×××ר××Ŗ, ××××ר ש×× × ××רש ש×הפר×× ×××רת ×Ŗ××× ×פר×××§× ××××Ø×”× ×©×× × ×Ø×צ×.
×××××Ŗ ×××Ŗ× ××××Ŗ ×©× peerDependencies ××× ××¤×¢× ××ש ××צ×××Ŗ. ×× ×ש ×× × package.json ×©× ×הפר×× ×©×× ××Ŗ ×××××§ ×××:
"peerDependencies": {
"react": "^17.0.2"
}
××××§×× ×©×× ×××××§ ×§××ׄ package.json ×¢× ××××§ ×××:
"dependencies": {
"mylib": "file:../mylib/mylib-1.0.1.tgz",
"react": "16.8.1"
}
×× ×ש××× ×× ×”× ×××Ŗ×§×× ××× ××§×× ××Ŗ ×××××¢×:
$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: myapp@1.0.0
npm ERR! Found: react@16.8.1
npm ERR! node_modules/react
npm ERR! react@"16.8.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.2" from mylib@1.0.2
npm ERR! node_modules/mylib
npm ERR! mylib@"file:../mylib/mylib-1.0.2.tgz" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry1 419
next_child = next(child for child in doc if '/'+child["key"] == pos+'/'+path[0])
except StopIteration:
doc.append({ "type": "d", 'key': key, 'title': path[-1], 'children': [] })
next_child = doc[-1]
return add_node(next_child["children"], path[1:], key, pos+'/'+path[0])
doc = []
for root, dirs, files in os.walk('.'):
key = root[1:].split('/')[1:]
node = add_node(doc, key, '/'.join(key))
prefix = '/'.join(key) + '/' if len(key) > 0 else ''
node.extend([{ "type": "f", "title": f, "key": f"{prefix}{f}", "children": [] } for i, f in enumerate(files)])
print(json.dumps(doc))
× ×Ŗ××× ×××××§ ××©× × - ×פ×× ×§×¦×× os.walk:
1. ×פע×××× ××Ŗ os.walk ××Ŗ×× for ××× ×ר×ׄ ×¢× ×× ××§×צ×× ×××Ŗ××§×××Ŗ ×צ××Ø× ×Ø×§×ר×××”××Ŗ ×עׄ ××Ŗ××§×××Ŗ.
2. ×× ×× ××”× ××××£ ×××××× ×××רת ×©× ×× ×”×Ŗ× ××Ŗ××§×× ××ש×. ×× × ×פע×× ××Ŗ ×פ×× ×§×¦×× add_node ××× ××××”××£ צ×××Ŗ ××ש ×עׄ ×××××§ ×××§×× ×©××Ŗ××× ××××Ŗ× ×Ŗ××§××. פ×× ×§×¦×××Ŗ add_node ×××××Ø× ××Ŗ ××¢×Ø× ×××××× ×©× ××Ŗ××§×× ×©××× ×ר××¢ ×××”×פ×.
3. ×××Ø× ×× ×× × ×שת×ש ×××©×Ŗ× × files ש×××ר ××××Ŗ× ×××ר××ר ××× ××××”××£ ×× ××Ŗ ×× ××§×צ×× ××××× ×××צע××Ŗ× ××Ŗ ××¢×Ø× ××××××.
×פ×× ×§×¦×× add_node ××××××Ŗ ×צ××Ø× ×Ø×§×ר×××”××Ŗ × Dictionary ××¤× ×××× × ×©× ××××× ××§×צ×× ××××”××¤× ×Ŗ××§×× ×××©× ×××§×× ×× ×××. ××× ×שת×שת × key ×©× ×× ×××××§× ××× ×××¢×Ŗ ××××× × ×Ŗ×××× ×× ××× ××Ŗ×× × Dictionary.1 419
# ×¢×× ××××× × os.walk × Python
×פ×× ×§×¦×× os.walk ×הפקת ××Ø× ×§×× ××¢××ר ×¢× ×× ×¢×„ ××§×צ×× ×××Ŗ××§×××Ŗ ××× ×× ×§×××Ŗ ××Ŗ××× ××”××××Ŗ. ×××××× ×פ××”× ×××× ×שת×ש ×× ××× ××× ××Ŗ ×××××§× JSON ש××Ŗ××× ×עׄ ×§×צ×× ××Ŗ××§×××Ŗ ×פ×ר×× ××”×××.
## ×× ×× ×× × ××× ××
× ×Ŗ×× ×¢×„ ×§×צ×× ××Ŗ××§×××Ŗ ×©× ×Ø×× ××:
.
āāā a
ā āāā b
ā ā āāā 00
ā ā ā āāā 11
ā ā ā āāā 22
ā ā ā āāā 33
ā ā ā āāā 44
ā ā āāā c
ā ā ā āāā c1.txt
ā ā ā āāā c2.txt
ā ā ā āāā d
ā ā āāā ff
ā ā āāā gg
ā āāā f1.txt
ā āāā f2.txt
āāā build_json.py
××× × ×Ø××¦× ××פ×× ×××Ŗ× ××××××§× JSON ×©× ×Ø×× ××:
[
{
"type": "f",
"title": "build_json.py",
"key": "build_json.py",
"children": []
},
{
"type": "d",
"key": "a",
"title": "a",
"children": [
{
"type": "f",
"title": "f1.txt",
"key": "a/f1.txt",
"children": []
},
{
"type": "f",
"title": "f2.txt",
"key": "a/f2.txt",
"children": []
},
{
"type": "d",
"key": "a/b",
"title": "b",
"children": [
{
"type": "d",
"key": "a/b/00",
"title": "00",
"children": [
{
"type": "d",
"key": "a/b/00/11",
"title": "11",
"children": [
{
"type": "d",
"key": "a/b/00/11/33",
"title": "33",
"children": []
},
{
"type": "d",
"key": "a/b/00/11/44",
"title": "44",
"children": []
},
{
"type": "d",
"key": "a/b/00/11/22",
"title": "22",
"children": []
}
]
}
]
},
{
"type": "d",
"key": "a/b/ff",
"title": "ff",
"children": [
{
"type": "d",
"key": "a/b/ff/gg",
"title": "gg",
"children": []
}
]
},
{
"type": "d",
"key": "a/b/c",
"title": "c",
"children": [
{
"type": "f",
"title": "c1.txt",
"key": "a/b/c/c1.txt",
"children": []
},
{
"type": "f",
"title": "c2.txt",
"key": "a/b/c/c2.txt",
"children": []
},
{
"type": "d",
"key": "a/b/c/d",
"title": "d",
"children": []
}
]
}
]
}
]
}
]
××× ×©××Ŗ××× ××§××פ×× × ×× ×©×צ××× ×¢×„ ×צ××Ø× ×רפ××Ŗ ×¢× ×××”×. ×××× × ×××× ×××:
1. ××××××§× ×ר××©× ××× ××¢×Ø× ×©× ×××××§×××
2. ×× ×××××§× ×××¢×Ø× ×××× 4 ש×××Ŗ: ש×× type ש×××× ×××××Ŗ d ×× f ××× ×צ××× ×× ×× ×Ŗ××§×× ×× ×§××ׄ; ש×× key ש×××× ××Ŗ ×× ×Ŗ×× ×××× ×××ר (×××× ×××××× ××× ×עׄ); ש×× title ש×××× ××Ŗ ×©× ×××ר ×ש×× ××©× children ש×××× ××¢×Ø× ×©× ×××××§××× ××××Ŗ× ××× × ×××××§.
3. ×× ××××××§× ××× ×§××ׄ ×× ××¢×Ø× ×××××× ×©×× ×Ø××§.
4. ×× ××××××§× ××× ×Ŗ××§×× ×× ××¢×Ø× ×××××× ×©×× ××××¦× ××Ŗ ××§×צ×× ×××Ŗ××§×××Ŗ ×©× ×צ××× ××Ŗ×× ××Ŗ××§××.
××××× ×× ×× ×”××Ŗ ××× ××Ŗ ××Ŗ ××× ×× ×× ××××Ø× ×× ×××ש×× ××§×× ×××××× ×©××.
## ××Ŗ××× ××Ŗ
×¢× os.walk ×× ×× × ×××××× ×××Ŗ×× ×× ×Ŗ××× ××Ŗ שע××רת ×¢× ×¢×„ ××§×צ×× ×צ××Ø× ×¤×©××× ×××× ××××Ŗ ×××××× ××ער. ×פ×× ×§×¦×× ×××××Ø× ×××ר××ר ש××× ×××רצ×× ×××ר ×Ŗ××§×× ××רת ×××××ר ××Ŗ רש×××Ŗ ××§×צ×× ×××Ŗ××§×××Ŗ ××××Ŗ× ×Ŗ××§×× ×©××× ××ר. ××××רצ×× ××× ××¤× ××”×ר ×××××Ŗ× ×©× ××§×צ×× ×××Ŗ××§×××Ŗ ×××× × ×× ××שת×ש ×× ××× ××× ××Ŗ ××Ŗ ×××××§× × JSON.
×× ××× ×פ×תר×× ×©××:
import os, json
def add_node(doc, path, key, pos=''):
if len(path) == 0:
return doc
try:1 419
# ××××× ××Ŗ ×©× ××ש×× ××ר×× ×××Ŗ× ×פשר×××
×ש ×××× ×©×× × ×××× ×ר×××Ŗ ×××ר×ר ××Ŗ ×××Ø× ××¤× ×ש×, ×פ××× ×× "ש×" ×× ××§×× ×××× ×Ø×××§ ××××¤× ×©×× × × ×צ×. ×× × ×××× ×©×× ××× ×ש × ×§××××Ŗ ×××Ø× ×××× ×©×¤×Ŗ××× ×Ø×××× ×××× ×××Ŗ ×”×××Ø× ×©× ×¦×¢××× ×©×× ×Ø×§ ×צ××× ××× ××××¢ ×××ר ××× ×©× ×Ø×× ×ר××¢ ×××× ×Ø×××§ ××××Ŗ× ×פשר×.
××ש ×××× ×©××× ×× × ×× ×Ø××× ××Ŗ ×××Ø× ××××. ש××××ר××Ŗ × ×¢×××Ŗ ×××ר××§ × ×Ø×× ×××Ŗ× × ××Ŗ× ×××ש×ר. ××××Ŗ שר×× ××××× ×× ×××× - ××××× ×× ××ר×× ××”××××× × ×Ø××× ×ר×× ×¤×¢××× ×××Ŗ× ×פשר×××.
×××Ø× ×צ××Ŗ ××פר×××§×” ×שר×צ×× ××ש×× ××ר ×××Ŗ× ××¤×©×Ø× ××× ×§××× ×× ××××× ×©×××ר ××× ××× ×× ××¤×©×Ø× - פש×× ××”×××. ×××ש×× ××ר×× ××”××××× ×× ×ר×× ××תר ×§× ×××ש×× ××ר×× ×××Ŗ× ×פשר×××. ××× ×× ×§× ××××× ×©×ש×× ××× ××¤×©×Ø× ×¤×©×× ××”×××, פש×× ××”×Ŗ×××× ×¢× ×× ×©×× ××ר×× ×©×צ×××× ×××Ŗ× ×× ×¢× ××××”××ר×× ×©××× ×× ×צ×××Ŗ× ××ר×× ×××××. ×× × ××××¢, ×× ×× × ×Ø××××× ××ש×× ×©×ש×× ××× ××¤×©×Ø× ×Ø×§ ×× ×× ×× × ×Ø×××× ××Ŗ ×××Ø× ××××× ×××× ×ש×. ××× ×××Ŗ פר×××××××× ×©×× ×©×× ×©×××××× ××× ×× ×××××× ××”××× ×¢×××.
××¦×¢× ××©× × ××× ××××× ×©×××Ø× ××ש×× ××ר×× ××”××××× ××× ×§×©×, ×ר××× ×××”××××Ŗ (× ×, ××רת ×× ×××× × ×¦×Ø×××× ×¤××”× ×¢× ××), ×ר×× ×××× ×©× ××× ×× ×××× ××××× ×©× ×¢×Ø×¤×, ××××× ××× ×× ×פשר ×××××× ×פ××× ××Ŗ ×××Ø× ×××× ×ש×. ××××× ××× ×× × ×Ø×× ×©×ש קשר ××× ××ש××× ×©××Ŗ× ×¢××©× ×¢×ש×× ×××× ×××ר ××××Ŗ× ××¤×©×Ø× ×©××Ŗ× ×Ø××¦× ××ש××.
×××Ø× ××××× ××××× ××Ŗ ×××©× ××× ××× × ×”××¢× ×¢× ×××ש ×ש×× ×ערפ×××. ×פשר ×ר×××Ŗ ××× ××ר×× ×§×××× - ×××Ŗ ××ש××× ××××××××Ŗ ×× ×××××Ŗ ש××Ŗ× ×¢××× ×¢××× - ××× ×§×©× ×××× ×ר×××Ŗ ××× ×××Ŗ× ×ש××× ××××× ××”××£ ××Ŗ×××× ××Ŗ×צ×× ×רצ×××. ××××× ×× ×× ×× ×§×©× ×××Ŗ××× ××ש××× ×× ×××××Ŗ, ××××××× ×× ××× ×שע×××Ŗ, קש×, ××Ŗ×”×××Ŗ, ×××¢××”× ×× ××צרת ר×ש××Ŗ ש×××××× ××ר×× ××× ×”××. ××× ×ש××××Ŗ קש××Ŗ × ××××Ŗ ×עש××Ŗ ××Ŗ ××.
××× ××××× ××Ŗ ×©× ××ש×× ××ר×× ×××Ŗ× ×פשר××× ××××× ×××”×Ŗ×× ××©×Ŗ× × ×§××××Ŗ:
1. ×ש×ש ר××¢ ×©× ×××ר××Ŗ, ×× ×× ×ש ××ר ש××ר ××Ŗ× ×Ŗ××× ××Ŗ ש××Ŗ× ×××××× ××§××Ŗ - ×Ŗ×× × ××× ×Ŗ××× ××Ŗ ×¢×××× ××”××רת, ×פ×ר××Ŗ ×××Ŗ×××. ××× ×××××Ŗ ×××××Ŗ ××Ŗ××× ×× ××ר×ש ××× ×Ŗ××××§ ××× ××ר ××××.
2. ××× ×©×ר ×××× ×Ŗ×¢××× ×Ŗ××× ×¢× ××ש××× ×××× ××Ŗ××× ××Ŗ ×¢××××. ××תר ××××××£ ×Ŗ××× ××Ŗ ×¢×××× ×Ø×§ ×ר××¢ ×©× ×××ר××Ŗ ×× ×× ×”××××Ŗ× ××Ŗ ×× ××ש××××Ŗ ש××.
ש××¢×ר ×××Ø× ×©××¢×ר, ×ש××× ×××Ø× ×ש××× ××¦×¢× ×××Ø× ×¦×¢× ×× ×××Ø× ×©×× × ××ש×× ×× ××Ŗ ×××ר×× ×©× ×Ø××× ×××× ×××Ŗ× ×פשר×××.
1 419
1. פ×× ××× ×§×× ×××× ×Ø. ×× ×פ×××Ŗ ××Ŗ×§××¤× ×קר××× ×××× ×× × × ×× ×××× ××ש×× ×¢××× ××Ŗ×ר ×§×× ×××× ×Ø. פ×× ×× ×ש×× ×©×Ø×„ ×¢× ×©×Ø×Ŗ ××Ŗ×× ××××', ××§×××Ø× ×××” ××××× ×©×××Ŗ× ×¤×× ××ש×× ×ר×ׄ ×× ×¢×× ×¦×Ø×× ×××Ŗ× ××× ××× ×תרהק ×§×××Ø× ××” ×ר×× ××× ××ש ×××§×××.
2. ××פ××××× × ×× ×× ×©××צר ××Ŗ ×פ××××, ××××ר ×××Ŗ ××Ŗ×§× × ×©× ×Ŗ××× ×. ×ר××¢ שש×××Ŗ× Deployment ××§×××Ø× ×××” ××× (×××?) ×× ×”× ××צ×ר ×§×× ×××× ×Ø×× (פ××××) ××Ŗ×× ××Ŗ×××ר ש××פ××¢ × Deployment.
3. הר×××” ×××Ŗ ×××Ø× ×©×× × ×××Ŗ××ר ×פ××. ×Ŗ×××Ø× ×©××§×××Ø× ×××” ×ש ×§×××”×ר ש×× ×©× ×©×Ø×Ŗ×× ×¢××× ××× ×××× ××ר×ׄ ××Ŗ ×פ×× ×©×××, ××× ×× ×שע×× ×× ×× ×× ××× ×שרת×× ×××× ×¢×××” ×§×××Ø× ×××” ×××× ××××× ××Ŗ ×פ×× ×שרת ×שרת. הר×××” ×× ×”×× ×©× ××פ×× ×¤×ר××× ×©×××ר ש×ש××Ŗ××ר×× ×פ××Ø× ××”××× × IP ×צ××××Ø× ×©× ××§×××”×ר ×× ×§×××Ø× ×××” צר×× ×××ר ××Ŗ×× ×פ×× ×××Ŗ×××, ×××¤× ×©××× ×× ×Ø×„ ×ר××¢.
×× ××× ××ש×××©× ×××× ×××××Ŗ ××××¦× ×¢× ××× ×§××ׄ YAML ש××Ŗ×ר ××Ŗ ×××פ××× ×× ×©××. ר××× × ××ר ×§××ׄ YAML ×¢××ר Deployment, ××× ××Ŗ× ×”×§×Ø× ×× ×× ×× × ×§××ׄ YAML פש×× ×¢××ר הר×××”:
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.25.0 (a70f80cc)
creationTimestamp: null
labels:
io.kompose.service: nginx
name: nginx
spec:
type: NodePort
ports:
- name: "80"
port: 80
targetPort: 80
selector:
io.kompose.service: nginx
status:
loadBalancer: {}
××§××ׄ ××Ŗ×ר הר×××” ש××Ŗ××ר × Deployment ×©× × nginx ש××¦×Ø× × ×§×××. ×××¤×Ŗ× ××××× ××Ŗ ××§××ׄ ××× ×××××§ ש××Ŗ××× ××××× selector, שק×××¢ ××××× ×Ŗ××× ××Ŗ ×הר×××” ××× ×¦×Ø×× ×××ר ×××Ŗ× ×, × port שק×××¢ ××××× ×¤××Ø× ×¦×Ø×× ×××Ŗ××ר ש×.
# ×§×××Ø× ×××” ×××¢× ×: ××Ŗ×§× × ×§×× ×פ××
×¢× ××¤× ×Ø××× × ×©×§×××Ø× ×××” ××× (×××?) ×ער××Ŗ ×פע×× ××§×××”×ר××. ר××× × ×©×תפק×× ×©×× ××× ××פע×× ×Ŗ××× ×××Ŗ, ××××ר ××××'××, ××××צר ××× ×§×× ×××× ×Ø×× ×××××× ×©×××Ŗ× ×§×× ×××× ×Ø×× ××ש×××× ×ר×ׄ ×××§×××× ××Ŗ ×ש××× ×שרת ש×× ×¦×Ø××××.
×××× × ××”×£ ×× ×× ××××××Ŗ ×ער××Ŗ ××פע×× ×Ŗ×¢××ר ×× × ××××× ××Ŗ ×§×××Ø× ×××” ××× ××××©× ×××Ŗ×§× × ×§×× ×פ××. ×ער××Ŗ ×פע×× ××××ר ××× ×××רת ××Ŗ ××Ŗ××× ×××Ŗ שרצ××Ŗ ×¢× ××××©× ×¢× ×××××Ø× ×©× ××××©× ×××צע××Ŗ ×ר×××ר××. ×Ŗ××× ××Ŗ ×× ×××Ŗ××Ŗ ×ש×ר××Ŗ ××××”×§ ××× ××Ŗ×××× ×ער××Ŗ ××פע××. ×Ŗ××× ××Ŗ ×× ×§×ר××Ŗ ×ש×ר××Ŗ ××××§×××Ŗ ××× ××Ŗ×××× ×ער××Ŗ ××פע××.
××××Ŗ× ××××¤× ×§×××Ø× ×××” ××Ŗ××× ××Ŗ ××××©× ×©× ××§×× ×××× ×Ø×× ××ש×××× ××צ×× ××× ×©× ×©×ר×× ××¢× ×. ××××××:
1. ×ער××Ŗ ××§×צ×× ×©× ×§×× ×××× ×Ø ×× ×©×ר××Ŗ ×ש××§×× ×××× ×Ø × ×”×ר. ××Ŗ×××× ×§×××Ø× ×××” ××§×× ×××× ×Ø ×××× ××§×× Volume ש×× ××§×× ×¢× ××××”×§ ש×פשר ×××Ŗ×× ×××× ××××××¢ ××ש×ר ×× ×ש××§×× ×××× ×Ø ×××”×ר.
2. ×§×× ×××× ×Ø ×××× ××§×× ××××¢ ×”××× ×××צע××Ŗ ×× ×× ×× Secrets ×©× ×§×××Ø× ×××”.
3. ×§×× ×××× ×Ø ×××× ××§×× ××©×Ŗ× × ×”×××× ×©×××¢×ר×× ×××× ××Ŗ×× ×§×××Ø× ×××”.
×§×××”×ר×× ×©×× ×× ×××××× ×××ש ××Ŗ ×××Ŗ×§× ×× ×××צ×× ××× ××ר××× ×©×× ××Ŗ: ×××××× ×§×××”×ר ×§×××Ø× ×××” שרׄ ×¢× ×¢× × ×©× Azure ×××× ×××ר Volume ×××× × ×××”×× ××¢× × ×©× ×××ר, ××§×××”×ר ××ר שרׄ ×¢× ××××× ×××ר ××Ŗ × Volume ×××× × ×××”×× ××¢× × ×©× ×××××. ××××× ×Ŗ ××Ŗ××× ××Ŗ ש×× × ×©×Ø×¦× ××Ŗ×× ××§×××”×ר ××××©× ××× ××× ××©× × ××קר××. ×× ×× × ××§×××× Volume ××§×××Ø× ×××” ××ר×× ×¢× ××פ×× ×××Ŗ× Volume ×××Ŗ×§× ×××××”×× ×××צ×× ×.
## ××× ××ש×××× ××××
××× ×××§××× ××××Ŗ ×¢×©×Ŗ× ××× ×שק ×××ש×× ×××××× ×§×××Ø× ×××” תש××× ×ש×××¢ ש×ש ××× ×”××£ ××ר×××× ××××× ×רשת ×××× ×××× ×©××Ŗ× × ××× ×תר×× ×צ××Ø× ××× ×רק×××××Ŗ. ×× × ××××ׄ ×××Ŗ××× ×××§×ש×ר ×××:
https://kubernetes.io/docs/tutorials/kubernetes-basics/ ש×××× ×”×××Ø× ×©× 6 ××××ר××××” ××× ×רק×××××× ××¢×××× ×¢× ×§×××Ø× ×××” ×××Ŗ×§× ×Ŗ ××ש×××× ×××צע××Ŗ×.
×¢××× ××Ŗ××¢×× ×ר××©× ×©× ×§×××Ø× ××” ××× ×× ××§×× ××××× ×צ××× ×× ××Ŗ× ×××××× ×קר×× ××××××Ŗ ×©× ××§×”× (× × ×× ×Ŗ×××× ×ש ×× ×Ŗ××× ××Ŗ). ×§×ש×ר:
https://kubernetes.io/docs/concepts/1 419
# ××ש××× ××”××”××× ××§×××Ø× ×××”
ש××¢×Ŗ× ×¢× ×§×××Ø× ×××” ××× ×× ×××××× ×× ××? ר×צ×× ××××× ××× ××××¢×× ×פ××× ×××¤× ×××Ŗ×××? ×פ××”× ××× ×ש××××× ××× × ××§××× ×©×צ××× ×עש××Ŗ קצת ×”×ר ××××§××× ××” ×©× ×§×Ø× ×§×××Ø× ×××”, ×פ×××Ŗ ×××Ŗ××× ×©××.
## ×§×××Ø× ×××” ××× ×ער××Ŗ ×פע×× ××§×××”×ר××
××Ŗ× ××××¢×× ××ר ש×××ש××× ×ש ×ער×××Ŗ ×פע××: ×ש Windows, Linux × OS/X; ×××פ×× ×× ×ש ××Ŗ Android × iOS ××¢×× ××× ××× ××ש××Ø× IOT ×ר×× ×¤×¢××× ××××¢×× ×¢× ××××ש×× ×ער××Ŗ ×פע×× ××××”×”×Ŗ ××× ××§×”.
×× ×©×× ×× ×× ××× ×××××××× ××× ×××ש×× ×©×פשר ×××צר ×ער××Ŗ ×פע×× ×× ××ש×× ×©××× ×× ××ש×. ××ש×× ×××× ××תר ×××ש×. ×××§×Ø× ×©×× × ××××”×£ ×©× ×©×Ø×Ŗ××. ×××”×£ ×©× ×©×Ø×Ŗ×× × ×§×Ø× Cluster ××§×××Ø× ×××” ××× (×××?) ×ער××Ŗ ×פע×× ××§×××”×ר××.
×ער××Ŗ ×פע×× ×Ø×××× ×©× ×××©× ××ר×××Ŗ ×¢× ×פע××Ŗ ×Ŗ××× ×××Ŗ ×× ×××× ×××××§×Ŗ ×ש××× ××ער××Ŗ ××Ŗ××× ×××Ŗ שרצ××Ŗ. ××× ×× ×××××Ŗ שת××× ×××Ŗ ×× ×××Ø×”× ×××Ŗ ××Ŗ ××©× ××, ××הפקת ××Ŗ××× ×××Ŗ ×××©× ×§×× ×××××× ×××Ŗ×§× × ××§×× ×¤×× ×©× ×××ש×. ××××ר ×× ×ש ×× ×Ŗ××× ××Ŗ ש××Ŗ××× ××ער××Ŗ ×פע×× Windows, ×× ×× ×× ××©× × ×× ×××× ×”×× ××§×××Ŗ ××××רת ××××©× ×× ×פ××× ×× ×× ××§×××Ŗ ×××××××Ŗ. ××Ŗ××× ××Ŗ ××§×××Ŗ ××Ŗ ××§×× ×××צע××Ŗ ××Ŗ×××× ×©× ×ער××Ŗ ××פע×× ×××××× ××¢××× ××××Ŗ× ×¦××Ø× ×¢× ×× ×××§××××Ŗ.
×ער××Ŗ ×פע×× ×©× ×§×××”×ר ×××§××Ŗ ×§×× ×”×¤× ××××, ×××פשרת ×× × ×××Ŗ×× "×Ŗ××× ×××Ŗ" שרצ××Ŗ ×¢× ××§×××”×ר. ×Ŗ××× ××Ŗ ×©×Ø×¦× ×¢× ×§×××”×ר ×Ŗ××× ×××Ø× ××× ×”×× ×©× ×”×Ø×××” ש××§×× ×קש××Ŗ ×ש××× ×Ŗ×©××××Ŗ - ××× Web Application ×× ××”××” × ×Ŗ×× ××. ×§×××Ø× ×××” תפע×× ××Ŗ ×××ש×××× ××××, ×Ŗ××× ××××§ ××× ××Ŗ ×ש××× ××§×××”×ר - ××××ר ×Ŗ×××× ×× ×ר×ׄ ×¢× ×××× ×©×Ø×Ŗ ××××× ×××§ ××שרת ××× ××§×× - ××Ŗ××× ××ש××ר ×××Ŗ× ××××× ×××פע×× ×××Ŗ× ×××ש ×× ××× ××× ×תרהק.
×××× ×©×Ŗ××× ××Ŗ ר×××× ×× ×¦×Ø××× ××××ר ××Ŗ ×××××Ø× ×¢×¦×× ×¢××× ××× ×Ø×¦×, ×× ××× ×Ŗ××× ×¢××××Ŗ ××Ŗ×××× ×ער××Ŗ ××פע××, ×× ×Ŗ××× ××Ŗ ×©×Ø×¦× ××Ŗ×× ×§×××Ø× ×××” ×× ×××××Ŗ ××××ר ××Ŗ ×שרת×× ×¢×¦×× ×¢×××× ××× ×Ø×¦×, ×××××× ××× ×× ×©×× ××Ŗ× ×××× ×צ××Ø× ××”××××Ŗ - ××¤× ×××שק ש××Ŗ××× ××Ŗ ××§×××Ŗ ××§×××Ø× ×××”, ××××ר ××ער××Ŗ ××פע××.
## ×Ŗ××× ×××Ŗ ×× ××××'××, ×Ŗ×××××× ×× ×§×× ×××× ×Ø××
××× ×©×ער××Ŗ ×פע×× ×©× ××ש××× ××××¢×Ŗ ××§××Ŗ ×§××¦× ×פע×× - ×××××× × Windows ×§××¦× EXE - ×××פע×× ×××Ŗ×, ××××ר ××צ×ר ××× ×Ŗ×××××× ×¢× ×××ש×, ×× ×§×××Ø× ×××” ××××¢×Ŗ ××§××Ŗ ×§××¦× ×פע×× ×©×× OCI Images ×××צ×ר ××× ×Ŗ×××××× ×©×× Containers.
××××' ××× ×× ×× ×©××Ŗ× ×××ר×× ××¢×××× ×¢× Docker ×× Podman. ×× ××××¢ ××× ××Ø× ×©××Ŗ×ר ×פ××קצ×× ××”××××Ŗ ×××Ŗ ×× ××Ŗ×××××Ŗ ×©× ×××Ŗ× ×פ××קצ××. ××××'×× ×××××”× ×× × Registries ××× ××¤× × ×§×××Ø× ×××” ×××¢× × ××פע×× ×§×× ×××× ×Ø ××Ŗ×× ××××' ×¢× ××קר ×××××× ×××צע××Ŗ ×פע××Ŗ:
$ docker run hello-world
×§×××Ø× ×××” ××Ŗ×ר ×ער××Ŗ ×פע×× ××××¢ (××××¢×Ŗ?) ××§××Ŗ ××××'×× ××× × hello-world ש×× × ×××ר×ׄ ×××Ŗ× ×¢× ××§×××”×ר, ××××ר ××× ××Ŗ ××× ×§×× ×××× ×Ø ×××Ŗ×Ŗ ××××Ŗ ××××× ××Ŗ ××§×××”×ר ××ר×ׄ ××Ŗ ××§×× ×××× ×Ø ×××. ×§×××Ø× ×××” ×× ×Ŗ×©×× ×× ×× ××§×× ×××× ×Ø ×תרהק ××Ŗ××¢ ××פע×× ×§×× ×××× ×Ø ××ש ××××Ŗ× ××××'.
××ער××Ŗ ×פע×× ×Ø×××× ×× ×× × ×שת×ש×× ××Ŗ××× ×Ŗ Installer ××× ×××Ŗ×§×× ××Ŗ ××Ŗ××× ×××Ŗ ש×× ×. ×× ×× × ××ר ×××ר×× ××רשת ×§××ׄ ××”××××Ŗ msi, ××ר×ׄ ×××Ŗ× ××× ××§×× ×Ŗ××× × ××××Ŗ ×× ××רת ×××× × ×× × ×¢× ×××ש×. ××§×××Ø× ×××” ×××Ŗ×§× × ××Ŗ×צעת ×××צע××Ŗ ×§××¦× ××§×”× ×פ×ר×× YAML ש××Ŗ×ר×× ××§×××”×ר ×× ×××××' ש×× ×× × ×Ø×צ×× ×××Ŗ×§×× ××× ×ר×ש××Ŗ ××ער××Ŗ ש××× ×¦×Ø××.
×××××× ××§××ׄ ××× ××× YAML ש××××ר Deployment (ש×× ××Ŗ×§× ×) ×©× ××××' ×©× ×©×Ø×Ŗ ×××× nginx:
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.25.0 (a70f80cc)
creationTimestamp: null
labels:
io.kompose.service: nginx
name: nginx
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: nginx
strategy: {}
template:
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.25.0 (a70f80cc)
creationTimestamp: null
labels:
io.kompose.service: nginx
spec:
containers:
- image: nginx
name: nginx
ports:
- containerPort: 80
resources: {}
restartPolicy: Always
status: {}
## פ××××, ××פ×××× ××” ×הר×××”××
ש×××©× ××ש××× ×©×××× ××××ר ××ר ××Ŗ××××Ŗ ××¢×××× ×©××× ×¢× ×§×××Ø× ××” ×× Pod, Deployment × Service (×ש ×¢×× ×ר××, ××× ××Ŗ ש××שת ××× × ×¦××Ø× ××ש ×××©× ×× ×ר×ש×× ×):1 419
×× ××§×ש×ר ×קר××× ×××תר ×× ×¢×× ××× ×××× ×× ××§×ש×ר
https://www.tocode.co.il/blog/2021-12-css-sticky-overflow
1 419
# ×××× ××××Ŗ×: CSS Sticky × overflow ×× ×××××× ××× ×××
××פ××× CSS Sticky ××× ×××Ø× ××× ×§×× ×××× ×××××ר שפה ×¢×××× ×××¢××× ××ש×× ×××××Ŗ ×××Ŗ× × ×ש×× ×× × ×××××× ××××, ×××¢×¦× "×××××§" ×ר×ש ××¢×××. ××× × ×× ×××××× ×ש×ש ××× ×××× ×××Ŗ× ×Ø×צ×× ×©×©×רת ×××תרת ×Ŗ×ש×× ×××××Ŗ ××Ŗ ××××ש ×× ×× ××× ×××× ×××× ××Ŗ ×ש×ר××Ŗ עצ××. ×× ×©××××× × sticky ×× ×××× ××××רת overflow: scroll ×¢× ××××× ×× ×©×× ×× × ×× ×××צר×× ×©× × ×¤×”× ××××× (××× ××צ×× × ××¢××× ×××©× × ×¤× ××× ×××××) ××× ×שת×ש ×××× ×פה ×××××× ×ר××× ×××צ×× × ×©× ××¢××× ××שש×רת ×××תרת ×©× ××××× ××××¢× ××××§ ××¢×××× ×©× ××¢××× ××× ×¤×©×× × ×××§×Ŗ ×ש×.
××§×צ×ר ×××”×¤×Ŗ× ××Ŗ ××××ר××Ŗ ×××Ŗ×××××Ŗ × position: sticky ×××××§ ××× ××Ŗ××¢×× ×צפ××Ŗ× ××××× ×שש×× ××ר ×× ×¢××. ×× × ××§××, ×Ŗ×××× × HTML ×××ר×× × CSS (××××× × ××Ŗ ×× ×¢× ××××Ŗ ש×ר××Ŗ):
<div class="root">
<table>
<thead>
<tr>
<th>name</th>
<th>hair color</th>
<th>city</th>
<th>gender</th>
</tr>
</thead>
<tbody>
<tr>
<td>bob</td>
<td>blue</td>
<td>foo</td>
<td>agender</td>
</tr>
<tr>
<td>bob</td>
<td>blue</td>
<td>foo</td>
<td>agender</td>
</tr>
</tbody>
<table>
</div>
.root {
overflow: hidden;
}
thead th {
position: sticky;
top: 0;
background: #d2d2d2;
padding: 2px 5px 2px 0;
}
table {
border-collapse: collapse;
}
×××§××פ×:
<iframe height="300" style="width: 100%;" scrolling="no" title="Untitled" src="https://codepen.io/ynonp/embed/qBPqXNQ?default-tab=html%2Cresult" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true">
See the Pen <a href="https://codepen.io/ynonp/pen/qBPqXNQ">
Untitled</a> by Ynon Perek (<a href="https://codepen.io/ynonp">@ynonp</a>)
on <a href="https://codepen.io">CodePen</a>.
</iframe>
××§× ×ר×××Ŗ ש××××× ×©× ×××”× ×× ××××Ŗ ×ש×××Ø× ××Ŗ ש×רת ×××תרת "××××§×" ×ר×ש ××¢×××. ×× ×§××Ø× ×¤×?
×תש××× ×התתרת ×××©×¤× ××× ××Ŗ×× MDN:
> Note that a sticky element "sticks" to its nearest ancestor that has a "scrolling mechanism" (created when overflow is hidden, scroll, auto, or overlay)
×× ××¢×ר××Ŗ - ×××× ×©××¢× ××××× ×ש ×× div ×¢× ××פ××× overflow: hidden, ××ר××Ŗ ×©× div ××× ××× ×××××Ŗ ×××× ×××× ×× ×××צר ××××× ×¤× ××××Ŗ, × sticky ×©× ××××× ×××× ××××§ ××××” ×××× ××× ××××” × body. ×××××× ××ר××Ŗ ש×רת ×××תרת ×©× ××××× ××× × ×××§×Ŗ ××××§ ××¢××××, פש×× ××××§ ××¢×××× ×©× × div שע×××£ ×××Ŗ×, ×××× ×× ×××¢×× ×××ׄ ××××§ ש×× ×× × ×Ø××××.
×פ×תר××? ××× ×Ŗ××× ×¤×©×× ×ש××××¢××. ×× ×¤×¢× ×©×Ø×צ×× ××שת×ש × position: sticky ×ש ××××× ×©××× ××¢×××× ×××× × ×¢× overflow. ×× × ××§×××¤× ×××Ŗ××§×:
<iframe height="300" style="width: 100%;" scrolling="no" title="Untitled" src="https://codepen.io/ynonp/embed/gOGLxrO?default-tab=html%2Cresult" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true">
See the Pen <a href="https://codepen.io/ynonp/pen/gOGLxrO">
Untitled</a> by Ynon Perek (<a href="https://codepen.io/ynonp">@ynonp</a>)
on <a href="https://codepen.io">CodePen</a>.
</iframe>1 419
# ××Ŗ× ××Ŗ××××× ××××¤× ××צ××× ×××?
××× ×©×Ŗ× ×©××××Ŗ ש×× ××Ŗ. ×× ×Ŗ× ×”× ×××ר ××× ×××.
×ר×× ×¤×¢××× ×× ×× × ××ש××× ×¢× ×ש××× ×××××××Ŗ ××××× ×× ××× ××©×§×¢× ×¦×Ø×× ×ש××× ××צע ×××Ŗ×, ××××× ×× ×©××× ×× × ×¢×ש×× ××Ŗ ××ש×××× ××××× ×עש××Ŗ ××Ŗ ××, ××× ××××× ××Ŗ ×××Ŗ×××. × ×××, ×× × ×××ר ×עצ××, ×× × ×××× ××צ×× ×©×¢× ×ש×××¢ ××××× CSS, ××× ×× × ×× ××××¢ ×©×©×¢× ×ש×××¢ ×× ×Ŗ×”×¤××§ ×ש××× ×××××¢ ××××©× ×ש××¢××Ŗ× ×× ×¢×××£ ××שק××¢ ××Ŗ ××©×¢× ××¤× ××× ×©×× ×ש×××¢ ××ש×× ××ר.
××Ŗ×צ×× ×©× ×× ××× ×××× ××× ×”×פ××Ŗ ×©× ××ר×× ×©×× ×× × ×Ø×צ×× ×עש××Ŗ ×× ××£ ×¤×¢× ×× ×פשר ××צ×× ×¢×©×Ø שע××Ŗ ×ש×××¢ ××שק××¢ ×××××× CSS.
×× ×©××פ××£ ×הפ××§ ××××Ø× ××××× ×¤× ×××× ×©××¤× × ×©××Ŗ××Ŗ× ×× ××× ××Ŗ××Ŗ× ×¤×¢×××× ×ש×××¢, ×××¤× × ×× ××Ŗ××Ŗ× ×¤×¢× ×ש×××¢. ×××××× ×××Ŗ××× ×××Ŗ×× ×××× ×× ×××Ŗ× ××Ŗ×פשרת ×× ×ר×ש ××××Ŗ× ×××©× ×©×¦×Ø×× ×××Ŗ×× ×¤××”× ×× ×××. ××××Ŗ× × ×§××× ×©×Ø×§ ××Ŗ×××Ŗ×, ××Ŗ××× ×× ××× × ×Ø××Ŗ× ×× ××× ××©×§×¢× ×××רפת. ×¤×¢× ×ש×××¢ ××× ×ש×× ×ר×× ××תר ×”××ר.
×××¢× ×©×× × ×××× × ×ש×××, ××××§×Ŗ ××× ×× ×××××××Ŗ ××צ×× ××× ×××ר×× ××©×Ŗ× × ×¢× ××××. ××× ×©×× ×× × ×¢×××§ ××תר ××Ŗ×× ×¤×Ø×××§× ×× ×§× ××תר ×××ש×× ×××צ×× ××תר ××× ×¢××ר×. ××Ŗ××× ××רשת ×ר×× ××תר ×× ×Ø××× ×××××©× ××©×¢× ××Ŗ××××Ŗ ×פר×××§× ××× ×ר×× ××תר "קש×" ××©×¢× ×××צע ש××.
×× ×ש ××× ×××× ×©×¢× ×××× ××××× CSS ×× ××××. ××× ×× ××Ŗ× ×Ø×צ×× ×××¢×Ŗ CSS ××× ××תר ××ש ××× ×Ø×§ ×©×¢× ×ש×××¢ ×ש××× ×× - ×× ×Ŗ×××. ××× ×©×Ŗ×Ŗ×§××× ×¢× ×××××× ×Ŗ×Ø×× ×©×©×¢× ×ש×××¢ ××פ××Ŗ ×שעת×××, שעת××× ××ר××¢ ×××”××£ ××××¢×× ××©×¢× ×××× ××§×××Ŗ. ××Ŗ××××× ××××. ××Ŗ ×××× ×פשר ××צ×× ×××ש×.
Available now! Telegram Research 2025 ā the year's key insights 
