Commit graph

28 commits

Author SHA1 Message Date
David
e2517d11e8
chore: add include_icons jinja global 2024-06-11 20:03:15 +02:00
Akhil Narang
26ae0f3460
fix: ruff fixes
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-07 17:04:31 +05:30
Ankush Menat
f34f7030a3 refactor: remove txt param from generate_hash use 2022-11-10 11:56:48 +05:30
Faris Ansari
4f650854b8
fix(dx): resolve_class (#18417)
* fix(resolve_class): ignore False values

* fix: allow multiple arguments

* fix: remove unnecessary condition

* test: resolve_class
2022-10-15 17:40:22 +05:30
Ankush Menat
4241f8c8c0 perf: simpler/faster preload header computation
We parse entire response to find preload headers, instead just use
include_style and include_script to include assets directly into preload
headers. This shaves off ~13% overhead in response.
2022-08-21 18:46:58 +05:30
Faris Ansari
d49f9bfb8f fix: handle case where web_block is invoked
from places other than web page
2022-06-22 12:04:57 +05:30
Faris Ansari
8814041b33 fix: set web-template attr in script and style tags from web templates
Also, deduplication of styles and scripts when web_blocks jinja method is used
2022-06-21 20:42:14 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
Faris Ansari
96ea14003d fix: generate dom id helper for jinja 2021-10-29 16:26:45 +05:30
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
2021-09-03 12:02:59 +05:30
Suraj Shetty
70e4b8a459 fix: Use different key for RTL assets 2021-07-05 14:39:46 +05:30
Suraj Shetty
30f9207091 feat: Select css-rtl folder if language is rtl 2021-06-28 12:03:00 +05:30
Suraj Shetty
40dd522796 feat: Auto generate RTL styles using rtlcss
https://github.com/MohammadYounes/rtlcss
2021-06-25 13:06:09 +05:30
Gavin D'souza
c489846547 Merge branch 'develop' into unnecessary_comprehensions 2021-06-11 19:30:23 +05:30
Gavin D'souza
8558116c70 Merge branch 'develop' of github.com:frappe/frappe into drop-py2-code 2021-05-31 18:28:28 +05:30
Aditya Hase
8aff94d514
fix(jinja): Remove frappe.utils.jinja.get_jenv() from jinja globals 2021-05-31 10:37:32 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* Remove six for PY2 compatability since our dependencies are not, PY2
  is legacy.
* Removed usages of utils from future/past libraries since they are
  deprecated. This includes 'from __future__ ...' and 'from past...'
  statements.
* Removed compatibility imports for PY2, switched from six imports to
  standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
  versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
2021-05-26 15:31:29 +05:30
Faris Ansari
16ff2de946 fix: Make bundled asset URL absolute always 2021-05-20 20:22:14 +05:30
Faris Ansari
f234761755 fix: Translate error message 2021-05-18 13:45:15 +05:30
Ankush Menat
d7eea22609
chore: misc translation/semgrep fixes 2021-05-12 20:38:19 +05:30
Ankush Menat
4754ab71d1
perf(minor): remove unnecessary comprehensions
- remove several unnecessary comprehensions from functions that accept a generator.
- Using `[x for x in iter]` causes a list to be built first then passed to the outer function.
- `any` and `all` can take generator instead. This makes memory usage O(1) and actually makes these functions short-circuiting. E.g. if the first condition fails then `all` will immediately return false instead of evaluating all the entries.
- `sum`, `min`, `max` => memory usage become O(1)
- `list`, `set`, `.join()` => roughly halves memory usage, as list is not required to be built.
- lastly, it's two fewer characters to read/think about.
2021-05-12 20:38:18 +05:30
Faris Ansari
add84065ad Merge remote-tracking branch 'upstream/develop' into esbuild 2021-05-07 12:55:04 +05:30
leela
72ca7e9753 refactor: remove six dependency 2021-05-07 07:42:04 +05:30
Faris Ansari
81d13607dd fix: Fallback value for bundled asset 2021-05-02 15:04:59 +05:30
Faris Ansari
e72bb135e1 fix: Asset URLs
Helpers to get asset path
Python: frappe.utils.jinja_globals.bundled_asset
JS: frappe.assets.bundled_asset
2021-04-29 14:47:52 +05:30
Faris Ansari
dd69f1ab43 fix: Hash based file naming
- For better HTTP caching and cache busting
- assets.json is created under [app]/dist folder which contains the map
of input file and output file name, this is used to get the correct path for
bundled assets
2021-04-29 13:30:07 +05:30
Faris Ansari
2f10daf562 Merge remote-tracking branch 'upstream/develop' into esbuild 2021-04-24 16:43:06 +05:30
Faris Ansari
1fd08d3960 refactor: Jinja hooks
- Rename hook from "jenv" to "jinja"
- You can now pass the path to the module and all of the methods in that
module will be added as methods
- You can also pass module path of a method

BREAKING CHANGE: Previous use of "jenv" hook won't work anymore
2021-04-17 16:11:28 +05:30