Commit graph

143 commits

Author SHA1 Message Date
Raffael Meyer
b91cacdd18
feat!: enhance Language to become more of a Locale (#27178) 2024-09-21 16:02:58 +02:00
David Arnold
1214763b25
Merge pull request #26737 from blaggacao/feat/cache-control
feat: add cache control
2024-09-11 23:32:57 +02:00
Shariq Ansari
2973739f2e fix: show Apps if multiple app or show CRM if only CRM is installed in dropdown 2024-08-30 15:42:58 +05:30
Shariq Ansari
9133f2a9c5 fix: added apps data in boot 2024-08-30 15:42:58 +05:30
David
1619cc0e58
feat: add cache control 2024-08-30 09:08:42 +02:00
David
e2517d11e8
chore: add include_icons jinja global 2024-06-11 20:03:15 +02:00
Akhil Narang
aa38d9e2f4
refactor: pipeline wherever possible, optimize calls
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-19 14:28:35 +05:30
Ankush Menat
de9ac89748 style: re-format with ruff 2024-02-05 18:53:33 +05:30
Suraj Shetty
2bf82e80ba fix: Make sure sitemap respects robot_txt 2024-02-05 15:41:05 +05:30
Hussain Nagaria
8d2137c265 docs: consistent doc strings 2023-12-18 18:27:39 +05:30
Ankush Menat
15384f88e0 chore: dead code/comment 2023-11-29 22:11:37 +05:30
Ankush Menat
957293bd54 fix: Only preload icons for desk 2023-11-29 21:50:18 +05:30
Corentin Flr
b079d3ef78
fix(web): Send first_day_of_the_week and number_format in bootinfo 2023-11-17 16:14:37 +01:00
David Arnold
18f34c36f6
fix(float): input formatting 2023-11-07 18:07:06 +01:00
Ankush Menat
e1f2f4bb54 fix: Let social login key control signups
There are cases where certain social login keys

- Should not allow signups at all and only allow logins. E.g. social media login keys.
- Should allow signups even if global sign ups are disabled. e.g. internal SSO like setups.
2023-10-14 12:43:48 +05:30
Ankush Menat
4122eba784 fix: Add crossorigin for preload
If crossorigin isn't specified browsers don't seem to use it.
2023-09-23 17:34:48 +05:30
Ankush Menat
428d78a491 chore: move svg icons to end and correct version 2023-09-23 15:17:05 +05:30
Ankush Menat
d7a9d0111c
perf: lazy load SVG icons (#22517)
| Metric                             | Before | After | Change    |
| ---                                | ---    | ---   | ---       |
| app.html first response size       | 421kb  | 106kb | -75% (!)  |
| First response duration            | 60ms   | 40ms  | -33%      |

huge thanks to @cogk for doing most of the work for this PR on this issue: https://github.com/frappe/frappe/issues/17449#issuecomment-1728328726

Co-authored-by: Corentin Flr <10946971+cogk@users.noreply.github.com>
2023-09-23 15:13:43 +05:30
barredterra
88c8baa9ee refactor: for append to extend, merge list extend
Replace a for append loop with list extend.
Create the list with values instead of creating
an empty list and extending it with another list.
2023-08-09 13:25:39 +02:00
barredterra
b553ed98d8 refactor: inline immediately returned variable
Inline a variable to a return in the case when the
variable being declared is immediately returned
2023-08-08 18:09:49 +02:00
barredterra
588bbd9d1c fix: include languages when clearing website cache 2023-07-18 12:53:57 +02:00
Ankush Menat
e4ec6e65ee fix: socketio namespace on website 2023-07-01 12:43:53 +05:30
Ankush Menat
3005e66e45 refactor!: Drop previously deprecated code 2023-06-13 16:00:43 +05:30
Ankush Menat
8485ac5d62 build(deps): bump many dependencies
test: change code to adapt to new werkzeug client

fix: avoid setting charset

utf8 is default and assumed now by werkzeug, setting this manually is
deprecated.

fix: use string instead of bytes for setting headers

DeprecationWarning: Passing bytes as a header value is deprecated and will not be supported in Werkzeug 3.0.
12:23:34 web.1         |   response.headers["X-Page-Name"] = path.encode("ascii", errors="xmlcharrefreplace")
2023-06-10 20:47:27 +05:30
Ankush Menat
fa6dc03cc8
refactor: frappe.cache() usage to frappe.cache (#21282) 2023-06-08 11:47:17 +05:30
Ankush Menat
392a506a76 perf: Cache published web forms 2023-06-04 15:13:39 +05:30
Ankush Menat
7c7c11b454 perf: Cache web view routes
Each call to evaluate if route is web view makes N queries where N = #
of web view doctypes. This entire computation can be definitely cached
for short duration.

- Added cache bursting in WebsiteGenerator doctype updates.
- Added 60 minutes TTL in case cache invalidation wasn't done reliably.
2023-06-04 15:13:39 +05:30
barredterra
b2e36634d6 refactor: rename get_time_zone to get_system_timezone 2023-03-04 19:30:03 +01:00
Shariq Ansari
0736f8a01b fix: load all boot data on website 2022-10-07 23:28:36 +05:30
Shariq Ansari
799cc62515 fix: get assets_json from boot 2022-10-05 16:34:02 +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
Shariq Ansari
a50e0ffa08
refactor: Webform (#17232) 2022-07-19 15:52:15 +05:30
Suraj Shetty
3e724cd2f2 fix: Use "html.parser" to avoid additional parser dependency
- result from html.parser is fine for further processing
2022-07-06 08:31:18 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
refactor: clean up code to py39+ supported syntax

- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes

Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
2022-07-01 11:51:05 +05:30
Suraj Shetty
27b49743e3 fix: Comment tag extractor code 2022-06-09 09:22:07 +05:30
Gavin D'souza
b696fa6da5 perf: Pre-compile and re-use regexp pattern
Converted all possible usages of re.* that weren't compiling the regex
separately and re-using it. Separated out the compiled patterns as
global variables. Repetitive patterns could be made DRY-er.

Would be nicer to have all regexes in a single module so that we could
re-use better, keep track of outdated, and keep checks for possible
reDos' etc
2022-06-08 14:07:38 +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
barredterra
745297a49d refactor: a not in b
Search: if not ([\w\d]*?) in ([\w\d]*?)
Replace: if $1 not in $2
2022-02-21 19:54:34 +01:00
Gavin D'souza
001075f88a fix: Use lru_cache instead of cache
* Mainly because it was introduced in PY39
* Making this change beacuse I'd like to evict cold caches too
2022-02-02 13:03:38 +05:30
Ankush Menat
5c17f9ad79
Merge pull request #15661 from gavindsouza/thumbnail-for-images
fix: Thumbnail for external images (from URL)
2022-02-02 12:21:06 +05:30
Gavin D'souza
c56b5a4899 Merge branch 'develop' of github.com:frappe/frappe into thumbnail-for-images 2022-01-31 11:26:31 +05:30
Gavin D'souza
5b6ceb5543 Merge branch 'develop' of github.com:frappe/frappe into set_value-refactor 2022-01-28 18:39:12 +05:30
Gavin D'souza
51fa09c4ab Merge branch 'develop' of github.com:frappe/frappe into thumbnail-for-images 2022-01-27 18:56:58 +05:30
Gavin D'souza
de2bcb08b4 fix!: Drop six PY2 compatibility package 2022-01-27 18:28:04 +05:30
Gavin D'souza
5503e18817 chore(typing): Add typing, style fixes
This was going to be a fix at first. Until I realised it couldn't...so I
removed the changes and kept the things back that helped me debug the
issue
2022-01-27 18:27:35 +05:30
Gavin D'souza
9dbaf252f0 fix: Check if binary file in Page Renderers
* Check if binary before rendering using StaticPage resolver
* Check if not binary before rendering using TemplatePage resolver
2022-01-19 19:30:45 +05:30
barredterra
b1383df15a refactor: use is None instead of == None 2022-01-17 10:37:51 +01:00
Gavin D'souza
3052808048 fix: Don't cast to str if None or Falsy
* refactor: use get_single_value instead of set_value(blah, None, blah1)
* User.reload in test_home_page to combat what happens locally
2022-01-10 15:05:57 +05:30
Paweł Wojciechowski
a956571d41
fix: Website URL parsing function parses absolute telephone/phone tel: URLs as relative (#14568)
* Update utils.py

Fix: #14567 

tel: URLs should be parsed as absolute path

* fix: Parsing telephone/phone tel: URLs as absolute
2021-10-26 05:34:23 +00:00
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